@@ -82,7 +82,7 @@ def assert_arg(key, value)
8282
8383 assert_array "#{ key } .allowed" , value [ 'allowed' ] , of : :string
8484
85- refute value [ 'name' ] . match ( /^-/ ) , "#{ key } .name must not start with a '-'"
85+ refute value [ 'name' ] . match ( /^-/ ) , "#{ key } .name must not start with '-'"
8686 end
8787
8888 def assert_flag ( key , value )
@@ -99,9 +99,9 @@ def assert_flag(key, value)
9999 assert_boolean "#{ key } .required" , value [ 'required' ]
100100 assert_array "#{ key } .allowed" , value [ 'allowed' ] , of : :string
101101
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' ]
105105 end
106106
107107 def assert_env_var ( key , value )
0 commit comments