MCPcopy
hub / github.com/spf13/cobra / NoArgs

Function NoArgs

args.go:42–47  ·  view source on GitHub ↗

NoArgs returns an error if any args are included.

(cmd *Command, args []string)

Source from the content-addressed store, hash-verified

40
41// NoArgs returns an error if any args are included.
42func NoArgs(cmd *Command, args []string) error {
43 if len(args) > 0 {
44 return fmt.Errorf("unknown command %q for %q", args[0], cmd.CommandPath())
45 }
46 return nil
47}
48
49// OnlyValidArgs returns an error if there are any positional args that are not in
50// the `ValidArgs` field of `Command`

Callers

nothing calls this directly

Calls 1

CommandPathMethod · 0.80

Tested by

no test coverage detected