@@ -100,19 +100,19 @@ def assert_arg(key, value)
100
100
101
101
refute value [ 'name' ] . match ( /^-/ ) , "#{ key } .name must not start with '-'"
102
102
103
- refute value [ 'required' ] && value [ 'default' ] , "#{ key } cannot have both required and default"
103
+ refute value [ 'required' ] && value [ 'default' ] , "#{ key } cannot have both nub` required` and nub` default` "
104
104
105
105
if value [ 'allowed' ]
106
106
assert ( value [ 'required' ] || value [ 'default' ] ) ,
107
- "#{ key } .allowed does not make sense without either default or required"
107
+ "#{ key } .allowed does not make sense without either nub` default` or nub` required` "
108
108
end
109
109
end
110
110
111
111
def assert_flag ( key , value )
112
112
assert_hash key , value , keys : Script ::Flag . option_keys
113
- assert value [ 'short' ] || value [ 'long' ] , "#{ key } must have at least one of long or short name "
113
+ assert value [ 'short' ] || value [ 'long' ] , "#{ key } must have at least one of nub` long` or nub` short` "
114
114
115
- refute value [ 'allowed' ] && value [ 'completions' ] , "#{ key } cannot have both allowed and completions"
115
+ refute value [ 'allowed' ] && value [ 'completions' ] , "#{ key } cannot have both nub` allowed` and nub` completions` "
116
116
117
117
assert_optional_string "#{ key } .long" , value [ 'long' ]
118
118
assert_optional_string "#{ key } .short" , value [ 'short' ]
@@ -132,20 +132,20 @@ def assert_flag(key, value)
132
132
assert value [ 'short' ] . match ( /^-[a-zA-Z0-9]$/ ) , "#{ key } .short must be in the form of '-n'" if value [ 'short' ]
133
133
refute value [ 'arg' ] . match ( /^-/ ) , "#{ key } .arg must not start with '-'" if value [ 'arg' ]
134
134
135
- refute value [ 'required' ] && value [ 'default' ] , "#{ key } cannot have both required and default"
135
+ refute value [ 'required' ] && value [ 'default' ] , "#{ key } cannot have both nub` required` and nub` default` "
136
136
137
137
if value [ 'default' ]
138
- assert value [ 'arg' ] , "#{ key } .default does not make sense without arg"
138
+ assert value [ 'arg' ] , "#{ key } .default does not make sense without nub` arg` "
139
139
end
140
140
141
141
if value [ 'allowed' ]
142
- assert value [ 'arg' ] , "#{ key } .allowed does not make sense without arg"
142
+ assert value [ 'arg' ] , "#{ key } .allowed does not make sense without nub` arg` "
143
143
assert ( value [ 'required' ] || value [ 'default' ] ) ,
144
- "#{ key } .allowed does not make sense without either default or required"
144
+ "#{ key } .allowed does not make sense without either nub` default` or nub` required` "
145
145
end
146
146
147
147
if value [ 'completions' ]
148
- assert value [ 'arg' ] , "#{ key } .completions does not make sense without arg"
148
+ assert value [ 'arg' ] , "#{ key } .completions does not make sense without nub` arg` "
149
149
end
150
150
end
151
151
@@ -161,8 +161,8 @@ def assert_env_var(key, value)
161
161
def assert_command ( key , value )
162
162
assert_hash key , value , keys : Script ::Command . option_keys
163
163
164
- refute value [ 'commands' ] && value [ 'args' ] , "#{ key } cannot have both commands and args"
165
- refute value [ 'commands' ] && value [ 'catch_all' ] , "#{ key } cannot have both commands and catch_all"
164
+ refute value [ 'commands' ] && value [ 'args' ] , "#{ key } cannot have both nub` commands` and nub` args` "
165
+ refute value [ 'commands' ] && value [ 'catch_all' ] , "#{ key } cannot have both nub` commands` and nub` catch_all` "
166
166
167
167
assert_string "#{ key } .name" , value [ 'name' ]
168
168
assert_optional_string "#{ key } .help" , value [ 'help' ]
@@ -209,7 +209,7 @@ def assert_command(key, value)
209
209
end
210
210
211
211
if value [ 'expose' ]
212
- assert value [ 'commands' ] , "#{ key } .expose makes no sense without commands"
212
+ assert value [ 'commands' ] , "#{ key } .expose makes no sense without nub` commands` "
213
213
end
214
214
215
215
if key == 'root'
0 commit comments