We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20c1281 commit 856cb19Copy full SHA for 856cb19
1 file changed
internal/pkg/args/args.go
@@ -44,8 +44,8 @@ func SingleArg(argName string, validate func(value string) error) cobra.Position
44
}
45
46
// 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
+// 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
49
func SingleOptionalArg(argName string, validate func(value string) error) cobra.PositionalArgs {
50
return func(cmd *cobra.Command, args []string) error {
51
if len(args) > 1 {
0 commit comments