cli, entry, lang: Add an entry package for embeddable CLI's
This adds a new entry package that allows embedded programs to exist inside of mgmt. This took a lot of refactoring to get the API right, but I think it's incredibly elegant now. There is a chance we tweak things a bit, but it's a good first start. All-in-one programs are coming soon!
This commit is contained in:
@@ -31,6 +31,12 @@ import (
|
||||
"github.com/alexflint/go-arg"
|
||||
)
|
||||
|
||||
func init() {
|
||||
if _, err := arg.NewParser(arg.Config{}, &Args{}); err != nil { // sanity check
|
||||
panic(errwrap.Wrapf(err, "invalid args cli struct"))
|
||||
}
|
||||
}
|
||||
|
||||
// CLI is the entry point for using mgmt normally from the CLI.
|
||||
func CLI(ctx context.Context, data *cliUtil.Data) error {
|
||||
// test for sanity
|
||||
|
||||
Reference in New Issue
Block a user