File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,8 @@ commands:
6060 - curl
6161 - wget
6262
63+ default : curl
64+
6365 examples :
6466 - cli download example.com
6567 - cli download example.com ./output -f
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ commands:
3838 - curl
3939 - wget
4040
41+ default : curl
42+
4143 examples :
4244 - cli download example.com
4345 - cli download example.com ./output -f
Original file line number Diff line number Diff line change @@ -101,6 +101,11 @@ def assert_arg(key, value)
101101 refute value [ 'name' ] . match ( /^-/ ) , "#{ key } .name must not start with '-'"
102102
103103 refute value [ 'required' ] && value [ 'default' ] , "#{ key } cannot have both required and default"
104+
105+ if value [ 'allowed' ]
106+ assert ( value [ 'required' ] || value [ 'default' ] ) ,
107+ "#{ key } .allowed does not make sense without either default or required"
108+ end
104109 end
105110
106111 def assert_flag ( key , value )
@@ -135,6 +140,8 @@ def assert_flag(key, value)
135140
136141 if value [ 'allowed' ]
137142 assert value [ 'arg' ] , "#{ key } .allowed does not make sense without arg"
143+ assert ( value [ 'required' ] || value [ 'default' ] ) ,
144+ "#{ key } .allowed does not make sense without either default or required"
138145 end
139146
140147 if value [ 'completions' ]
You can’t perform that action at this time.
0 commit comments