mirror of
https://github.com/status-im/consul.git
synced 2025-01-24 20:51:10 +00:00
command: backport patch for mitchellh/cli help flag handling (#3536)
This patch backports a fix which will show the correct usage screen for command line flags. This is considered a temporary fix until the code has been refactored. Newer versions of the cli library require that the flag set is populated when Help() is called or that it is populated within Help() itself. Fixes #3536
This commit is contained in:
parent
ce0d03c46a
commit
59b84fcda3
12
vendor/github.com/mitchellh/cli/cli.go
generated
vendored
12
vendor/github.com/mitchellh/cli/cli.go
generated
vendored
@ -578,12 +578,6 @@ func (c *CLI) processArgs() {
|
||||
break
|
||||
}
|
||||
|
||||
// Check for help flags.
|
||||
if arg == "-h" || arg == "-help" || arg == "--help" {
|
||||
c.isHelp = true
|
||||
continue
|
||||
}
|
||||
|
||||
// Check for autocomplete flags
|
||||
if c.Autocomplete {
|
||||
if arg == "-"+c.AutocompleteInstall || arg == "--"+c.AutocompleteInstall {
|
||||
@ -604,6 +598,12 @@ func (c *CLI) processArgs() {
|
||||
continue
|
||||
}
|
||||
|
||||
// Check for help flags.
|
||||
if arg == "-h" || arg == "-help" || arg == "--help" {
|
||||
c.isHelp = true
|
||||
continue
|
||||
}
|
||||
|
||||
if arg != "" && arg[0] == '-' {
|
||||
// Record the arg...
|
||||
c.topFlags = append(c.topFlags, arg)
|
||||
|
Loading…
x
Reference in New Issue
Block a user