Group fields of Command
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Albert Nigmatzianov · committed by Albert Nigmatzianov · parent 1251aef · Browse files · 1 file·+21 added−19 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+21 added−19 removed
- other:+21 added−19 removed
Provenance
- Commit
90d2fd8- Tree
16809a4- Author
Albert Nigmatzianov <albertnigma@gmail.com>- Committer
Albert Nigmatzianov <albertnigma@gmail.com>- Parent
1251aef
1 file changed+21 added−19 removed
modified:command.go+21 added-19 removed
53 unmodified lines54 // but accepted if entered manually.55 ArgAliases []string56 // BashCompletionFunction is custom functions used by the bash autocompletion generator.57 BashCompletionFunction string58- // Deprecated defines, if this command deprecated and should print this string when used.58+ // Deprecated defines, if this command is deprecated and should print this string when used.59 Deprecated string60- // Hidden defines, if this command hidden and should NOT show up in the list of available commands.60+ // Hidden defines, if this command is hidden and should NOT show up in the list of available commands.61 Hidden bool62 // Annotations are key/value pairs that can be used by applications to identify or63 // group commands.64 Annotations map[string]string65- // flags is full set of flags.66- flags *flag.FlagSet67- // pflags contains persistent flags.68- pflags *flag.FlagSet69- // lflags contains local flags.70- lflags *flag.FlagSet71- // iflags contains inherited flags.72- iflags *flag.FlagSet73- // parentsPflags is all persistent flags of cmd's parents.74- parentsPflags *flag.FlagSet65 // SilenceErrors is an option to quiet errors down stream.66 SilenceErrors bool67 // Silence Usage is an option to silence usage when an error occurs.68 SilenceUsage bool45 unmodified lines114 // max lengths of commands' string lengths for use in padding.115 commandsMaxUseLen int116 commandsMaxCommandPathLen int117 commandsMaxNameLen int128- // commandsAreSorted defines, if commands slice are sorted or not.118+ // commandsAreSorted defines, if command slice are sorted or not.119 commandsAreSorted bool130- // flagErrorBuf contains all error messages from pflag.131- flagErrorBuf *bytes.Buffer120+121 // args is actual args parsed from flags.122 args []string123+ // flagErrorBuf contains all error messages from pflag.124+ flagErrorBuf *bytes.Buffer125+ // flags is full set of flags.126+ flags *flag.FlagSet127+ // pflags contains persistent flags.128+ pflags *flag.FlagSet129+ // lflags contains local flags.130+ lflags *flag.FlagSet131+ // iflags contains inherited flags.132+ iflags *flag.FlagSet133+ // parentsPflags is all persistent flags of cmd's parents.134+ parentsPflags *flag.FlagSet135+ // globNormFunc is the global normalization function136+ // that we can use on every pflag set and children commands137+ globNormFunc func(f *flag.FlagSet, name string) flag.NormalizedName138+139 // output is an output writer defined by user.140 output io.Writer141 // usageFunc is usage func defined by user.142 usageFunc func(*Command) error5 unmodified lines148 // helpTemplate is help template defined by user.149 helpTemplate string150 // helpFunc is help func defined by user.151 helpFunc func(*Command, []string)147- // helpCommand is command with usage 'help'. If it not defined by user,152+ // helpCommand is command with usage 'help'. If it's not defined by user,153 // cobra uses default help command.154 helpCommand *Command150- // globNormFunc is the global normalization function151- // that we can use on every pflag set and children commands152- globNormFunc func(f *flag.FlagSet, name string) flag.NormalizedName155 }156 157 // SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden158 // particularly useful when testing.1123 unmodified lines