aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Perfilov <pnv902@gmail.com>2022-06-24 23:56:23 +0300
committerNikolay Perfilov <pnv902@gmail.com>2022-06-24 23:56:23 +0300
commit78f5df6c67aaf7898dc41af27b66109f893f98cc (patch)
tree913064e6c4f96ee86892e9082bad368101546585
parent65c7ffdf697142f26cd596b782b92b106efc9415 (diff)
downloadydb-78f5df6c67aaf7898dc41af27b66109f893f98cc.tar.gz
Fix new version options to work without profile, KIKIMR-15119
ref:efce2c2612426dae28cee343e6198ebae07340ea
-rw-r--r--ydb/public/lib/ydb_cli/common/command.h24
1 files changed, 2 insertions, 22 deletions
diff --git a/ydb/public/lib/ydb_cli/common/command.h b/ydb/public/lib/ydb_cli/common/command.h
index 6948990a44..41d2683302 100644
--- a/ydb/public/lib/ydb_cli/common/command.h
+++ b/ydb/public/lib/ydb_cli/common/command.h
@@ -133,17 +133,7 @@ public:
}
bool IsVersionCommand() {
- TString lastArg = ArgV[ArgC - 1];
- if (lastArg == "version") {
- return true;
- }
- if (ArgC > 1) {
- TString penultimateArg = ArgV[ArgC - 2];
- if (penultimateArg == "version" && lastArg == "--semantic") {
- return true;
- }
- }
- return false;
+ return HasArgs({ "version" });
}
bool IsVersionForceCheckCommand() {
@@ -155,17 +145,7 @@ public:
}
bool IsUpdateCommand() {
- TString lastArg = ArgV[ArgC - 1];
- if (lastArg == "update") {
- return true;
- }
- if (ArgC > 1) {
- TString penultimateArg = ArgV[ArgC - 2];
- if (penultimateArg == "update" && (lastArg == "--force" || lastArg == "-f")) {
- return true;
- }
- }
- return false;
+ return HasArgs({ "update" });
}
bool IsInitCommand() {