Skip to content

Commit

Permalink
improved commandline parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
denisri committed Oct 2, 2023
1 parent 855ccc3 commit 2c551ad
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions capsul/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,19 @@ def executable_parser(executable):
field = executable.field(name)
done.add(name)
if field.type is int:
value = int(value)
if value == 'None' or value == 'null' or value == 'undefined':
value = undefined
else:
value = int(value)
elif field.type is float:
if value == 'None' or value == 'null' or value == 'undefined':
value = undefined
else:
value = float(value)
elif field.type is str or field.is_path():
if value and value[0] == '"':
if value == 'None' or value == 'null' or value == 'undefined':
value = undefined
elif value and value[0] == '"':
value = json.loads(value)
else:
value = json.loads(value)
Expand Down

0 comments on commit 2c551ad

Please sign in to comment.