Skip to content
Myr

Disable flags in UseLine (#552)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Daniel Nephin · committed by Albert Nigmatzianov · parent d6948b7 · Browse files · 1 file+7 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: Daniel Nephin <dnephin@gmail.com>

Diff stats

1 file+7 added−0 removed

  • other:+7 added−0 removed

1 file+7 added−0 removed

modified:command.go+7 added
116 unmodified lines
117 // DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...")118 // will be printed by generating docs for this command.119 DisableAutoGenTag bool120121 // DisableFlagsInUseLine will disable the addition of [flags] to the usage122 // line of a command when printing help or generating docs123 DisableFlagsInUseLine bool124125 // DisableSuggestions disables the suggestions based on Levenshtein distance126 // that go along with 'unknown command' messages.127 DisableSuggestions bool128 // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions.
868 unmodified lines
997 useline = c.parent.CommandPath() + " " + c.Use998 } else {999 useline = c.Use1000 }1001 if c.DisableFlagsInUseLine {1002 return useline1003 }1004 if c.HasAvailableFlags() && !strings.Contains(useline, "[flags]") {1005 useline += " [flags]"1006 }1007 return useline
407 unmodified lines