SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands. The user should not have a cyclic dependency on commands.
(n func(f *flag.FlagSet, name string) flag.NormalizedName)
| 380 | // SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands. |
| 381 | // The user should not have a cyclic dependency on commands. |
| 382 | func (c *Command) SetGlobalNormalizationFunc(n func(f *flag.FlagSet, name string) flag.NormalizedName) { |
| 383 | c.Flags().SetNormalizeFunc(n) |
| 384 | c.PersistentFlags().SetNormalizeFunc(n) |
| 385 | c.globNormFunc = n |
| 386 | |
| 387 | for _, command := range c.commands { |
| 388 | command.SetGlobalNormalizationFunc(n) |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | // OutOrStdout returns output to stdout. |
| 393 | func (c *Command) OutOrStdout() io.Writer { |