Merge pull request #339 from jack230230/master

Add App.Metadata
This commit is contained in:
Dan Buch 2016-04-30 09:36:46 -04:00
commit e671f0b23b
2 changed files with 3 additions and 1 deletions

2
app.go
View File

@ -80,6 +80,8 @@ type App struct {
Email string
// Writer writer to write output to
Writer io.Writer
// Other custom info
Metadata map[string]interface{}
}
// Tries to find out when this binary was compiled.

View File

@ -211,7 +211,7 @@ 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)
if c.HelpName == "" {