vendor: patch github.com/mitchellh/cli until help output is fixed

We need to init the flagset that cli uses to generate the help
outside of the Run method since Run isn't called anymore for
printing help.
This commit is contained in:
Frank Schroeder 2017-05-24 23:53:05 +02:00
parent 205cbe5fc8
commit c0680660d5
No known key found for this signature in database
GPG Key ID: 4D65C6EAEC87DECD
1 changed files with 6 additions and 6 deletions

View File

@ -398,12 +398,6 @@ func (c *CLI) processArgs() {
break break
} }
// Check for help flags.
if arg == "-h" || arg == "-help" || arg == "--help" {
c.isHelp = true
continue
}
if c.subcommand == "" { if c.subcommand == "" {
// Check for version flags if not in a subcommand. // Check for version flags if not in a subcommand.
if arg == "-v" || arg == "-version" || arg == "--version" { if arg == "-v" || arg == "-version" || arg == "--version" {
@ -411,6 +405,12 @@ func (c *CLI) processArgs() {
continue continue
} }
// Check for help flags.
if arg == "-h" || arg == "-help" || arg == "--help" {
c.isHelp = true
continue
}
if arg != "" && arg[0] == '-' { if arg != "" && arg[0] == '-' {
// Record the arg... // Record the arg...
c.topFlags = append(c.topFlags, arg) c.topFlags = append(c.topFlags, arg)