mirror of
https://github.com/spf13/cobra
synced 2025-04-22 06:37:19 +00:00
Merge 6cf30ea481
into ceb39aba25
This commit is contained in:
commit
7baad3c4ca
1 changed files with 4 additions and 0 deletions
|
@ -150,6 +150,10 @@ func genFlagResult(flags *pflag.FlagSet) []cmdOption {
|
|||
var result []cmdOption
|
||||
|
||||
flags.VisitAll(func(flag *pflag.Flag) {
|
||||
if flag.Hidden {
|
||||
return
|
||||
}
|
||||
|
||||
// Todo, when we mark a shorthand is deprecated, but specify an empty message.
|
||||
// The flag.ShorthandDeprecated is empty as the shorthand is deprecated.
|
||||
// Using len(flag.ShorthandDeprecated) > 0 can't handle this, others are ok.
|
||||
|
|
Loading…
Add table
Reference in a new issue