MCPcopy Create free account
hub / github.com/algolia/cli / NoArgs

Function NoArgs

pkg/validators/cmd.go:24–33  ·  view source on GitHub ↗

NoArgs is a validator for commands to print an error when an argument is provided

()

Source from the content-addressed store, hash-verified

22
23// NoArgs is a validator for commands to print an error when an argument is provided
24func NoArgs() cobra.PositionalArgs {
25 return func(cmd *cobra.Command, args []string) error {
26 extractArgs := ExactArgsWithMsg(0, fmt.Sprintf(
27 "`%s` does not take any positional arguments.",
28 cmd.CommandPath(),
29 ))
30
31 return extractArgs(cmd, args)
32 }
33}
34
35// ExactArgs is the same as ExactArgsWithMsg but displays
36// a default error message

Callers 15

NewGetCmdFunction · 0.92
NewSignupCmdFunction · 0.92
NewLoginCmdFunction · 0.92
NewLogoutCmdFunction · 0.92
NewCrawlerCmdFunction · 0.92
NewOperationsCmdFunction · 0.92
NewListCmdFunction · 0.92
NewAddCmdFunction · 0.92
NewDowngradeCmdFunction · 0.92
NewUpdateCmdFunction · 0.92
NewListCmdFunction · 0.92
NewSelectCmdFunction · 0.92

Calls 1

ExactArgsWithMsgFunction · 0.85

Tested by

no test coverage detected