Remove NewApp initializer

and move defaulting to `App.Setup`
This commit is contained in:
Dan Buch
2016-06-22 12:47:57 -04:00
parent b5f16ff767
commit df685fbacc
9 changed files with 808 additions and 761 deletions

View File

@@ -164,10 +164,11 @@ func (c *Command) HasName(name string) bool {
}
func (c *Command) startApp(ctx *Context) error {
app := NewApp()
app.Metadata = ctx.App.Metadata
// set the name and usage
app.Name = fmt.Sprintf("%s %s", ctx.App.Name, c.Name)
app := &App{
Metadata: ctx.App.Metadata,
Name: fmt.Sprintf("%s %s", ctx.App.Name, c.Name),
}
if c.HelpName == "" {
app.HelpName = c.HelpName
} else {