NilStringFlag defines a new flag with a string pointer receiver. This is useful for differentiating between the flag being set to a blank value and the flag not being passed at all.
(cmd *cobra.Command, p **string, name string, shorthand string, usage string)
| 13 | // NilStringFlag defines a new flag with a string pointer receiver. This is useful for differentiating |
| 14 | // between the flag being set to a blank value and the flag not being passed at all. |
| 15 | func NilStringFlag(cmd *cobra.Command, p **string, name string, shorthand string, usage string) *pflag.Flag { |
| 16 | return cmd.Flags().VarPF(newStringValue(p), name, shorthand, usage) |
| 17 | } |
| 18 | |
| 19 | // NilBoolFlag defines a new flag with a bool pointer receiver. This is useful for differentiating |
| 20 | // between the flag being explicitly set to a false value and the flag not being passed at all. |
no test coverage detected