File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ func SingleArg(argName string, validate func(value string) error) cobra.Position
4444}
4545
4646// SingleOptionalArg checks if one or no arguments were provided and validates it if provided
47- // using the validate function. It returns an error if the argument is invalid.
48- // For no validation, you can pass a nil validate function
47+ // using the validate function. It returns an error if more than one argument is provided, or if
48+ // the argument is invalid. For no validation, you can pass a nil validate function
4949func SingleOptionalArg (argName string , validate func (value string ) error ) cobra.PositionalArgs {
5050 return func (cmd * cobra.Command , args []string ) error {
5151 if len (args ) > 1 {
You can’t perform that action at this time.
0 commit comments