Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect C# in OS.get_cmdline_args docs #90985

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions doc/classes/OS.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,26 +189,26 @@
for argument in OS.get_cmdline_args():
if argument.contains("="):
var key_value = argument.split("=")
arguments[key_value[0].lstrip("--")] = key_value[1]
arguments[key_value[0].trim_prefix("--")] = 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("--")] = ""
arguments[argument.trim_prefix("--")] = ""
[/gdscript]
[csharp]
var arguments = new Godot.Collections.Dictionary();
var arguments = new Dictionary<string, string>();
AThousandShips marked this conversation as resolved.
Show resolved Hide resolved
foreach (var argument in OS.GetCmdlineArgs())
{
if (argument.Contains('='))
{
string[] keyValue = argument.Split("=");
arguments[keyValue[0].LStrip("--")] = keyValue[1];
arguments[keyValue[0].TrimPrefix("--")] = keyValue[1];
}
else
{
// Options without an argument will be present in the dictionary,
// with the value set to an empty string.
AThousandShips marked this conversation as resolved.
Show resolved Hide resolved
arguments[keyValue[0].LStrip("--")] = "";
arguments[argument.TrimPrefix("--")] = "";
}
}
[/csharp]
Expand Down
Loading