MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / RequiresArguments

Function RequiresArguments

internal/cmd/plugin/plugin.go:214–222  ·  view source on GitHub ↗

RequiresArguments will show the help message in case no argument has been provided

(nArgs int)

Source from the content-addressed store, hash-verified

212
213// RequiresArguments will show the help message in case no argument has been provided
214func RequiresArguments(nArgs int) cobra.PositionalArgs {
215 return func(cmd *cobra.Command, args []string) error {
216 if len(args) < nArgs {
217 _ = cmd.Help()
218 os.Exit(0)
219 }
220 return nil
221 }
222}

Callers 15

clusterCmdFunction · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92
cmd.goFile · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected