mirror of
https://github.com/spf13/cobra
synced 2024-11-24 14:47:12 +00:00
Do not generate docs for hidden flags
This commit is contained in:
parent
9d15fe657a
commit
6cf30ea481
1 changed files with 4 additions and 0 deletions
|
@ -149,6 +149,10 @@ func genFlagResult(flags *pflag.FlagSet) []cmdOption {
|
||||||
var result []cmdOption
|
var result []cmdOption
|
||||||
|
|
||||||
flags.VisitAll(func(flag *pflag.Flag) {
|
flags.VisitAll(func(flag *pflag.Flag) {
|
||||||
|
if flag.Hidden {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Todo, when we mark a shorthand is deprecated, but specify an empty message.
|
// Todo, when we mark a shorthand is deprecated, but specify an empty message.
|
||||||
// The flag.ShorthandDeprecated is empty as the shorthand is deprecated.
|
// The flag.ShorthandDeprecated is empty as the shorthand is deprecated.
|
||||||
// Using len(flag.ShorthandDeprecated) > 0 can't handle this, others are ok.
|
// Using len(flag.ShorthandDeprecated) > 0 can't handle this, others are ok.
|
||||||
|
|
Loading…
Reference in a new issue