MCPcopy
hub / github.com/cli/cli / ExactArgs

Function ExactArgs

pkg/cmdutil/args.go:24–36  ·  view source on GitHub ↗
(n int, msg string)

Source from the content-addressed store, hash-verified

22}
23
24func ExactArgs(n int, msg string) cobra.PositionalArgs {
25 return func(cmd *cobra.Command, args []string) error {
26 if len(args) > n {
27 return FlagErrorf("too many arguments")
28 }
29
30 if len(args) < n {
31 return FlagErrorf("%s", msg)
32 }
33
34 return nil
35 }
36}
37
38func NoArgsQuoteReminder(cmd *cobra.Command, args []string) error {
39 if len(args) < 1 {

Callers 14

NewCmdDeleteFunction · 0.92
newCmdCloneFunction · 0.92
newCmdDeleteFunction · 0.92
newCmdEditFunction · 0.92
newCmdCreateFunction · 0.92
NewCmdDevelopFunction · 0.92
NewCmdTransferFunction · 0.92
NewCmdCreateFunction · 0.92
NewInspectCmdFunction · 0.92
NewVerifyCmdFunction · 0.92
NewDownloadCmdFunction · 0.92
NewCmdDeleteFunction · 0.92

Calls 1

FlagErrorfFunction · 0.85

Tested by

no test coverage detected