@@ -82,7 +82,7 @@ def assert_arg(key, value)
82
82
83
83
assert_array "#{ key } .allowed" , value [ 'allowed' ] , of : :string
84
84
85
- refute value [ 'name' ] . match ( /^-/ ) , "#{ key } .name must not start with a '-'"
85
+ refute value [ 'name' ] . match ( /^-/ ) , "#{ key } .name must not start with '-'"
86
86
end
87
87
88
88
def assert_flag ( key , value )
@@ -99,9 +99,9 @@ def assert_flag(key, value)
99
99
assert_boolean "#{ key } .required" , value [ 'required' ]
100
100
assert_array "#{ key } .allowed" , value [ 'allowed' ] , of : :string
101
101
102
- assert value [ 'long' ] . match ( /^--[^ \s ]+$/ ) , "#{ key } .long must be in the form of '--name'" if value [ 'long' ]
103
- assert value [ 'short' ] . match ( /^-[^ \s ]$/ ) , "#{ key } .short must be in the form of '-n'" if value [ 'short' ]
104
- refute value [ 'arg' ] . match ( /^-/ ) , "#{ key } .arg must not start with a '-'" if value [ 'arg' ]
102
+ assert value [ 'long' ] . match ( /^--[a-zA-Z0-9_ \- ]+$/ ) , "#{ key } .long must be in the form of '--name'" if value [ 'long' ]
103
+ assert value [ 'short' ] . match ( /^-[a-zA-Z0-9 ]$/ ) , "#{ key } .short must be in the form of '-n'" if value [ 'short' ]
104
+ refute value [ 'arg' ] . match ( /^-/ ) , "#{ key } .arg must not start with '-'" if value [ 'arg' ]
105
105
end
106
106
107
107
def assert_env_var ( key , value )
0 commit comments