Updates for cli and context

cli adds new global options. We'll be able to specify flags that
apply to multiple options now.

context update fixes parallelWriter function, actually writes a value out now.
This commit is contained in:
Frederick F. Kautz IV
2014-12-11 09:19:20 -08:00
parent e107c3204d
commit c2290dd1d4
9 changed files with 318 additions and 63 deletions
+6 -1
View File
@@ -24,6 +24,8 @@ type App struct {
EnableBashCompletion bool
// Boolean to hide built-in help command
HideHelp bool
// Boolean to hide built-in version flag
HideVersion bool
// An action to execute when the bash-completion flag is set
BashComplete func(context *Context)
// An action to execute before any subcommands are run, but after the context is ready
@@ -75,7 +77,10 @@ func (a *App) Run(arguments []string) error {
if a.EnableBashCompletion {
a.appendFlag(BashCompletionFlag)
}
a.appendFlag(VersionFlag)
if !a.HideVersion {
a.appendFlag(VersionFlag)
}
// parse flags
set := flagSet(a.Name, a.Flags)