Skip to content

Commit 8c6a599

Browse files
authored
Fix ydb cli command list parse path call (#14433)
1 parent 5a8b1e9 commit 8c6a599

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ void TCommandList::Parse(TConfig& config) {
10711071

10721072
void TCommandList::ExtractParams(TConfig& config) {
10731073
TClientCommand::ExtractParams(config);
1074-
ParsePath(config, 0);
1074+
ParsePath(config, 0, true);
10751075
}
10761076

10771077
int TCommandList::Run(TConfig& config) {

ydb/public/lib/ydb_cli/common/command.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,12 @@ void TClientCommandTree::RenderCommandsDescription(
446446
}
447447

448448
void TCommandWithPath::ParsePath(const TClientCommand::TConfig& config, const size_t argPos, bool isPathOptional) {
449-
if (config.ParseResult->GetFreeArgCount() < argPos + 1 && isPathOptional) {
449+
if (config.ParseResult->GetFreeArgCount() <= argPos) {
450450
if (isPathOptional) {
451451
Path = ".";
452452
}
453453
} else {
454-
Path = config.ParseResult->GetFreeArgs()[argPos];
454+
Path = config.ParseResult->GetFreeArgs().at(argPos);
455455
}
456456

457457
AdjustPath(config);

0 commit comments

Comments
 (0)