From 5f95a9e88b7bb61d461c453041f546d0f195692b Mon Sep 17 00:00:00 2001 From: jszwedko Date: Tue, 10 Mar 2015 07:59:59 -0700 Subject: [PATCH 1/3] Fix support for deprecated author fields Should add an author if either name or email is specified. --- app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.go b/app.go index 3e7d5a6..cd0d058 100644 --- a/app.go +++ b/app.go @@ -81,7 +81,7 @@ func NewApp() *App { // Entry point to the cli app. Parses the arguments slice and routes to the proper flag/args combination func (a *App) Run(arguments []string) (err error) { - if a.Author != "" && a.Author != "" { + if a.Author != "" || a.Email != "" { a.Authors = append(a.Authors, Author{a.Author, a.Email}) } From 7beac44ab1173acf1f10bf7a4310b5a15b3df383 Mon Sep 17 00:00:00 2001 From: jszwedko Date: Tue, 10 Mar 2015 08:03:05 -0700 Subject: [PATCH 2/3] Don't default authors --- app.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/app.go b/app.go index cd0d058..8701320 100644 --- a/app.go +++ b/app.go @@ -72,9 +72,6 @@ func NewApp() *App { BashComplete: DefaultAppComplete, Action: helpCommand.Action, Compiled: compileTime(), - Author: "Dr. James", - Email: "who@gmail.com", - Authors: []Author{{"Jim", "jim@corporate.com"}, {"Hank", "hank@indiepalace.com"}}, Writer: os.Stdout, } } From b95607c608f1bd870702373791c944032e5338b0 Mon Sep 17 00:00:00 2001 From: jszwedko Date: Tue, 10 Mar 2015 08:12:44 -0700 Subject: [PATCH 3/3] Use named struct fields --- app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.go b/app.go index 8701320..3d4ed12 100644 --- a/app.go +++ b/app.go @@ -79,7 +79,7 @@ func NewApp() *App { // Entry point to the cli app. Parses the arguments slice and routes to the proper flag/args combination func (a *App) Run(arguments []string) (err error) { if a.Author != "" || a.Email != "" { - a.Authors = append(a.Authors, Author{a.Author, a.Email}) + a.Authors = append(a.Authors, Author{Name: a.Author, Email: a.Email}) } if HelpPrinter == nil {