From 1a0fa2dde68f2cea5b69483b35673f38ca91b3d7 Mon Sep 17 00:00:00 2001 From: "Andrii Doroshenko (Xrayez)" Date: Mon, 9 Aug 2021 23:36:28 +0300 Subject: [PATCH] Use `index` over `idx` for CLI option arguments --- core/command_line_parser.cpp | 6 +++--- doc/CommandLineParser.xml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/command_line_parser.cpp b/core/command_line_parser.cpp index 698d15ac..0c6155bb 100644 --- a/core/command_line_parser.cpp +++ b/core/command_line_parser.cpp @@ -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())); diff --git a/doc/CommandLineParser.xml b/doc/CommandLineParser.xml index c93835e7..8748e313 100644 --- a/doc/CommandLineParser.xml +++ b/doc/CommandLineParser.xml @@ -107,7 +107,7 @@ - + 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.). @@ -172,14 +172,14 @@ - + Removes option at specified index [code]idx[/code]. - + Replaces option at specified index [code]idx[/code] with [code]option[/code].