This repository was archived by the owner on Nov 22, 2024. It is now read-only.
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):
212212 elif opt in ('-D' , '--delete' ):
213213 method = 'DELETE'
214214
215- digits_only = re .compile ('^[0-9]+$' )
215+ digits_only = re .compile ('^-?[0-9]+$' )
216+ floats_only = re .compile ('^-?[0-9.]+$' )
216217
217218 # next grab the params. These are in the form of tag=value
218219 params = None
@@ -222,8 +223,16 @@ def cli4(args):
222223 value = True
223224 elif value_string == 'false' :
224225 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 ))
225230 elif value_string [0 ] is '=' and digits_only .match (value_string [1 :]):
226231 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 ))
227236 elif value_string [0 ] in '[{' and value_string [- 1 ] in '}]' :
228237 # a json structure - used in pagerules
229238 try :
You can’t perform that action at this time.
0 commit comments