From 88ea7cbec8b0c5e10ae30a6a597a6621b6613130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=8C=AF=E5=A8=81?= Date: Wed, 2 Mar 2016 10:45:13 +0800 Subject: [PATCH] Add App extras info --- app.go | 2 ++ command.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app.go b/app.go index 1ea3fd0..503f838 100644 --- a/app.go +++ b/app.go @@ -62,6 +62,8 @@ type App struct { Email string // Writer writer to write output to Writer io.Writer + // Other custom info + Extras map[string]interface{} } // Tries to find out when this binary was compiled. diff --git a/command.go b/command.go index 0153713..0ccffa2 100644 --- a/command.go +++ b/command.go @@ -197,7 +197,7 @@ func (c Command) HasName(name string) bool { func (c Command) startApp(ctx *Context) error { app := NewApp() - + app.Extras = ctx.App.Extras // set the name and usage app.Name = fmt.Sprintf("%s %s", ctx.App.Name, c.Name) if c.HelpName == "" {