aboutsummaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/codegangsta/cli/app.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-25 04:25:11 +0800
committerobscuren <geffobscura@gmail.com>2015-03-25 04:25:11 +0800
commit3d5f48a1602a2dbe6d9a4d123e5b3aa4f51d53a1 (patch)
treee6692d3c0de3bacfe02d0114bfdbea5a866ca7ad /Godeps/_workspace/src/github.com/codegangsta/cli/app.go
parenta6e659f74b199d2caec54a00916217ec5439c05b (diff)
downloadgo-tangerine-3d5f48a1602a2dbe6d9a4d123e5b3aa4f51d53a1.tar
go-tangerine-3d5f48a1602a2dbe6d9a4d123e5b3aa4f51d53a1.tar.gz
go-tangerine-3d5f48a1602a2dbe6d9a4d123e5b3aa4f51d53a1.tar.bz2
go-tangerine-3d5f48a1602a2dbe6d9a4d123e5b3aa4f51d53a1.tar.lz
go-tangerine-3d5f48a1602a2dbe6d9a4d123e5b3aa4f51d53a1.tar.xz
go-tangerine-3d5f48a1602a2dbe6d9a4d123e5b3aa4f51d53a1.tar.zst
go-tangerine-3d5f48a1602a2dbe6d9a4d123e5b3aa4f51d53a1.zip
updated deps
Diffstat (limited to 'Godeps/_workspace/src/github.com/codegangsta/cli/app.go')
-rw-r--r--Godeps/_workspace/src/github.com/codegangsta/cli/app.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/Godeps/_workspace/src/github.com/codegangsta/cli/app.go b/Godeps/_workspace/src/github.com/codegangsta/cli/app.go
index 3e7d5a63c..cd2900519 100644
--- a/Godeps/_workspace/src/github.com/codegangsta/cli/app.go
+++ b/Godeps/_workspace/src/github.com/codegangsta/cli/app.go
@@ -5,6 +5,7 @@ import (
"io"
"io/ioutil"
"os"
+ "strings"
"text/tabwriter"
"text/template"
"time"
@@ -72,17 +73,14 @@ 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,
}
}
// 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 != "" {
- a.Authors = append(a.Authors, Author{a.Author, a.Email})
+ if a.Author != "" || a.Email != "" {
+ a.Authors = append(a.Authors, Author{Name: a.Author, Email: a.Email})
}
if HelpPrinter == nil {
@@ -91,8 +89,12 @@ func (a *App) Run(arguments []string) (err error) {
}()
HelpPrinter = func(templ string, data interface{}) {
+ funcMap := template.FuncMap{
+ "join": strings.Join,
+ }
+
w := tabwriter.NewWriter(a.Writer, 0, 8, 1, '\t', 0)
- t := template.Must(template.New("help").Parse(templ))
+ t := template.Must(template.New("help").Funcs(funcMap).Parse(templ))
err := t.Execute(w, data)
if err != nil {
panic(err)