summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-06-19 14:09:13 +0200
committerGitHub <noreply@github.com>2022-06-19 14:09:13 +0200
commit958254ec3eeb5d55888b5bcbf121d2f55b88a9de (patch)
tree54e0ffdd001f2c63015ddd55f3b8797e8ad1f0b1
parent833b16cdf0ca43e521a17bb0ee8b4e33b831de37 (diff)
parentcd4b60d0d4e3b8acce5aaa4656fd342c677db4e2 (diff)
Merge pull request #60798 from Calinou/doc-os-cmdline-args
-rw-r--r--doc/classes/OS.xml10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index e6d5ea61da..aaf08dec2f 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -175,6 +175,10 @@
if argument.find("=") &gt; -1:
var key_value = argument.split("=")
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("--")] = ""
[/gdscript]
[csharp]
var arguments = new Godot.Collections.Dictionary();
@@ -185,6 +189,12 @@
string[] keyValue = argument.Split("=");
arguments[keyValue[0].LStrip("--")] = keyValue[1];
}
+ else
+ {
+ // Options without an argument will be present in the dictionary,
+ // with the value set to an empty string.
+ arguments[keyValue[0].LStrip("--")] = "";
+ }
}
[/csharp]
[/codeblocks]