cli: Pass through program and version strings

We forgot to pass these through. If they're undefined, it errors.
This commit is contained in:
James Shubin
2016-10-24 17:41:03 -04:00
parent 71de8014d5
commit aa9a21b4d0

View File

@@ -32,6 +32,9 @@ func run(c *cli.Context) error {
obj := &Main{} obj := &Main{}
obj.Program = c.App.Name
obj.Version = c.App.Version
if s := c.String("prefix"); c.IsSet("prefix") && s != "" { if s := c.String("prefix"); c.IsSet("prefix") && s != "" {
obj.Prefix = &s obj.Prefix = &s
} }
@@ -114,9 +117,9 @@ func CLI(program, version string) error {
return fmt.Errorf("Program was not compiled correctly. Please see Makefile.") return fmt.Errorf("Program was not compiled correctly. Please see Makefile.")
} }
app := cli.NewApp() app := cli.NewApp()
app.Name = program app.Name = program // App.name and App.version pass these values through
app.Usage = "next generation config management"
app.Version = version app.Version = version
app.Usage = "next generation config management"
//app.Action = ... // without a default action, help runs //app.Action = ... // without a default action, help runs
app.Commands = []cli.Command{ app.Commands = []cli.Command{