Skip to content

Commit

Permalink
Fix ydb cli command list parse path call (#14433)
Browse files Browse the repository at this point in the history
  • Loading branch information
Enjection authored Feb 11, 2025
1 parent 5a8b1e9 commit 8c6a599
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ void TCommandList::Parse(TConfig& config) {

void TCommandList::ExtractParams(TConfig& config) {
TClientCommand::ExtractParams(config);
ParsePath(config, 0);
ParsePath(config, 0, true);
}

int TCommandList::Run(TConfig& config) {
Expand Down
4 changes: 2 additions & 2 deletions ydb/public/lib/ydb_cli/common/command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,12 @@ void TClientCommandTree::RenderCommandsDescription(
}

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

AdjustPath(config);
Expand Down

0 comments on commit 8c6a599

Please sign in to comment.