MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / unknownSubcommandRun

Function unknownSubcommandRun

cmd/pad/groups.go:13–18  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

11// nonexistentsubcommand`). When called with no args the parent's help is
12// shown and nil is returned.
13func 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
20func authCmd() *cobra.Command {
21 cmd := &cobra.Command{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected