RequiresArguments will show the help message in case no argument has been provided
(nArgs int)
| 212 | |
| 213 | // RequiresArguments will show the help message in case no argument has been provided |
| 214 | func RequiresArguments(nArgs int) cobra.PositionalArgs { |
| 215 | return func(cmd *cobra.Command, args []string) error { |
| 216 | if len(args) < nArgs { |
| 217 | _ = cmd.Help() |
| 218 | os.Exit(0) |
| 219 | } |
| 220 | return nil |
| 221 | } |
| 222 | } |
no outgoing calls
no test coverage detected