File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -212,7 +212,8 @@ def cli4(args):
212
212
elif opt in ('-D' , '--delete' ):
213
213
method = 'DELETE'
214
214
215
- digits_only = re .compile ('^[0-9]+$' )
215
+ digits_only = re .compile ('^-?[0-9]+$' )
216
+ floats_only = re .compile ('^-?[0-9.]+$' )
216
217
217
218
# next grab the params. These are in the form of tag=value
218
219
params = None
@@ -222,8 +223,16 @@ def cli4(args):
222
223
value = True
223
224
elif value_string == 'false' :
224
225
value = False
226
+ elif value_string == '' :
227
+ value = None
228
+ elif value_string [0 ] is '=' and value_string [1 :] == '' :
229
+ exit ('cli4: %s== - no number value passed' % (tag_string ))
225
230
elif value_string [0 ] is '=' and digits_only .match (value_string [1 :]):
226
231
value = int (value_string [1 :])
232
+ elif value_string [0 ] is '=' and floats_only .match (value_string [1 :]):
233
+ value = float (value_string [1 :])
234
+ elif value_string [0 ] is '=' :
235
+ exit ('cli4: %s== - invalid number value passed' % (tag_string ))
227
236
elif value_string [0 ] in '[{' and value_string [- 1 ] in '}]' :
228
237
# a json structure - used in pagerules
229
238
try :
You can’t perform that action at this time.
0 commit comments