Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SingleArg ¶
func SingleArg(argName string, validate func(value string) error) cobra.PositionalArgs
SingleArg checks if only one non-empty argument was provided and validates it using the validate function. It returns an error if none or multiple arguments are provided, or if the argument is invalid. For no validation, you can pass a nil validate function
func SingleOptionalArg ¶
func SingleOptionalArg(argName string, validate func(value string) error) cobra.PositionalArgs
SingleOptionalArg checks if one or no arguments were provided and validates it if provided using the validate function. It returns an error if more than one argument is provided, or if the argument is invalid. For no validation, you can pass a nil validate function
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.