unknownSubcommandRun returns an error when the user passes an unrecognized subcommand (e.g. a typo like `pad item nonexistentsubcommand`). When called with no args the parent's help is shown and nil is returned.
(cmd *cobra.Command, args []string)
| 11 | // nonexistentsubcommand`). When called with no args the parent's help is |
| 12 | // shown and nil is returned. |
| 13 | func unknownSubcommandRun(cmd *cobra.Command, args []string) error { |
| 14 | if len(args) > 0 { |
| 15 | return fmt.Errorf("unknown command %q for %q", args[0], cmd.CommandPath()) |
| 16 | } |
| 17 | return cmd.Help() |
| 18 | } |
| 19 | |
| 20 | func authCmd() *cobra.Command { |
| 21 | cmd := &cobra.Command{ |
nothing calls this directly
no outgoing calls
no test coverage detected