mirror of https://github.com/status-im/consul.git
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:
parent
205cbe5fc8
commit
c0680660d5
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue