aboutsummaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/codegangsta/cli/help.go
diff options
context:
space:
mode:
Diffstat (limited to 'Godeps/_workspace/src/github.com/codegangsta/cli/help.go')
-rw-r--r--Godeps/_workspace/src/github.com/codegangsta/cli/help.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/Godeps/_workspace/src/github.com/codegangsta/cli/help.go b/Godeps/_workspace/src/github.com/codegangsta/cli/help.go
index a246f63ac..15916f86a 100644
--- a/Godeps/_workspace/src/github.com/codegangsta/cli/help.go
+++ b/Godeps/_workspace/src/github.com/codegangsta/cli/help.go
@@ -15,7 +15,7 @@ var AppHelpTemplate = `NAME:
{{.Name}} - {{.Usage}}
USAGE:
- {{.HelpName}} {{if .Flags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}
+ {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} {{if .Flags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}
{{if .Version}}
VERSION:
{{.Version}}
@@ -180,7 +180,9 @@ func printHelp(out io.Writer, templ string, data interface{}) {
t := template.Must(template.New("help").Funcs(funcMap).Parse(templ))
err := t.Execute(w, data)
if err != nil {
- panic(err)
+ // If the writer is closed, t.Execute will fail, and there's nothing
+ // we can do to recover. We could send this to os.Stderr if we need.
+ return
}
w.Flush()
}