Initialize goes through the registered commands, and their flagsets and initializes the help template command registry. This must be called after all commands are added as sub-commands, because cmd.CommandPath relies on the commands having parents.
()
| 28 | // This must be called after all commands are added as sub-commands, because |
| 29 | // cmd.CommandPath relies on the commands having parents. |
| 30 | func Initialize() { |
| 31 | for cmd, fs := range commandFlagSets { |
| 32 | commandPathFlagSets[cmd.CommandPath()] = fs |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | // RegisterFlagSets registers flags to be included in a commands usage text (--help). |
| 37 | func RegisterFlagSets(cmd *cobra.Command, flagsets ...*pflag.FlagSet) { |
no outgoing calls
searching dependent graphs…