mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-02-04 15:15:56 +01:00
Handle CLI arguments without a value in OS.get_cmdline_args()
example
Command lines such as `--host --address 127.0.0.1` are now parsed as `{"host": "", "address": "127.0.0.1"}`.
This commit is contained in:
parent
24db598946
commit
b55610eeed
@ -161,6 +161,10 @@
|
|||||||
if argument.find("=") > -1:
|
if argument.find("=") > -1:
|
||||||
var key_value = argument.split("=")
|
var key_value = argument.split("=")
|
||||||
arguments[key_value[0].lstrip("--")] = key_value[1]
|
arguments[key_value[0].lstrip("--")] = key_value[1]
|
||||||
|
else:
|
||||||
|
# Options without an argument will be present in the dictionary,
|
||||||
|
# with the value set to an empty string.
|
||||||
|
arguments[argument.lstrip("--")] = ""
|
||||||
[/codeblock]
|
[/codeblock]
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
Loading…
Reference in New Issue
Block a user