From aa9a21b4d0ff131b66bf0bb942d01a82e370a0f8 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Mon, 24 Oct 2016 17:41:03 -0400 Subject: [PATCH] cli: Pass through program and version strings We forgot to pass these through. If they're undefined, it errors. --- mgmtmain/cli.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mgmtmain/cli.go b/mgmtmain/cli.go index 8c43a93e..08687aa0 100644 --- a/mgmtmain/cli.go +++ b/mgmtmain/cli.go @@ -32,6 +32,9 @@ func run(c *cli.Context) error { obj := &Main{} + obj.Program = c.App.Name + obj.Version = c.App.Version + if s := c.String("prefix"); c.IsSet("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.") } app := cli.NewApp() - app.Name = program - app.Usage = "next generation config management" + app.Name = program // App.name and App.version pass these values through app.Version = version + app.Usage = "next generation config management" //app.Action = ... // without a default action, help runs app.Commands = []cli.Command{