Skip to content

Commit

Permalink
Use index over idx for CLI option arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Xrayez committed Aug 9, 2021
1 parent d6cb740 commit 1a0fa2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions core/command_line_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,9 @@ void CommandLineParser::_bind_methods() {

ClassDB::bind_method(D_METHOD("add_option", "option"), &CommandLineParser::add_option);
ClassDB::bind_method(D_METHOD("get_option_count"), &CommandLineParser::get_option_count);
ClassDB::bind_method(D_METHOD("get_option", "idx"), &CommandLineParser::get_option);
ClassDB::bind_method(D_METHOD("set_option", "idx", "option"), &CommandLineParser::set_option);
ClassDB::bind_method(D_METHOD("remove_option", "idx"), &CommandLineParser::remove_option);
ClassDB::bind_method(D_METHOD("get_option", "index"), &CommandLineParser::get_option);
ClassDB::bind_method(D_METHOD("set_option", "index", "option"), &CommandLineParser::set_option);
ClassDB::bind_method(D_METHOD("remove_option", "index"), &CommandLineParser::remove_option);
ClassDB::bind_method(D_METHOD("find_option", "name"), &CommandLineParser::find_option);

ClassDB::bind_method(D_METHOD("new_option", "name", "description", "default_value", "allowed_values"), &CommandLineParser::new_option, DEFVAL(""), DEFVAL(""), DEFVAL(PoolStringArray()));
Expand Down
6 changes: 3 additions & 3 deletions doc/CommandLineParser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
</method>
<method name="get_option" qualifiers="const">
<return type="CommandLineOption" />
<argument index="0" name="idx" type="int" />
<argument index="0" name="index" type="int" />
<description>
Returns the option at index position [code]idx[/code]. Negative indices can be used to count from the back, like in Python (-1 is the last element, -2 the second to last, etc.).
</description>
Expand Down Expand Up @@ -172,14 +172,14 @@
</method>
<method name="remove_option">
<return type="void" />
<argument index="0" name="idx" type="int" />
<argument index="0" name="index" type="int" />
<description>
Removes option at specified index [code]idx[/code].
</description>
</method>
<method name="set_option">
<return type="void" />
<argument index="0" name="idx" type="int" />
<argument index="0" name="index" type="int" />
<argument index="1" name="option" type="CommandLineOption" />
<description>
Replaces option at specified index [code]idx[/code] with [code]option[/code].
Expand Down

0 comments on commit 1a0fa2d

Please sign in to comment.