diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2023-06-15 17:08:15 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2023-06-15 17:08:15 +0300 |
commit | 418f14ed6c44f2081292e29a5688d42816a12aa0 (patch) | |
tree | 38269929853b2e20e41d6a0b789b72e51859f20f | |
parent | 388313e00d93558eb8877127d6ba7032add9e433 (diff) | |
download | ydb-418f14ed6c44f2081292e29a5688d42816a12aa0.tar.gz |
Intermediate changes
-rw-r--r-- | build/sysincl/macro.yml | 5 | ||||
-rw-r--r-- | ydb/public/lib/ydb_cli/commands/ydb_profile.cpp | 13 | ||||
-rw-r--r-- | ydb/public/lib/ydb_cli/commands/ydb_profile.h | 2 | ||||
-rw-r--r-- | ydb/public/lib/ydb_cli/common/interactive.cpp | 2 |
4 files changed, 19 insertions, 3 deletions
diff --git a/build/sysincl/macro.yml b/build/sysincl/macro.yml index b0828f3ca1..e31336a87e 100644 --- a/build/sysincl/macro.yml +++ b/build/sysincl/macro.yml @@ -686,6 +686,11 @@ includes: - BOOST_PP_ITERATE() +# market uses include-via-define by design, just ignore this includes +- source_filter: "^market/media_adv/library/experiments" + includes: + - MARKET_MADV_EXP_FLAGS_FILENAME + # Connectedhomeip contrib uses a special type of imports for third-party includes https://github.com/project-chip/connectedhomeip/issues/4354 # Also empty MACROs here defined for Linux and ESP32 platforms, but esp32 files use third-party library esp-idf # So there are some problems to resolve imports especially in contrib/libs/connectedhomeip/src/app, diff --git a/ydb/public/lib/ydb_cli/commands/ydb_profile.cpp b/ydb/public/lib/ydb_cli/commands/ydb_profile.cpp index 46f6eee8c0..0644465d27 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_profile.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_profile.cpp @@ -1043,11 +1043,12 @@ int TCommandUpdateProfile::Run(TConfig& config) { } TCommandReplaceProfile::TCommandReplaceProfile() - : TCommandProfileCommon("replace", {}, "Create new configuration profile or delete and re-configure existing one") + : TCommandProfileCommon("replace", {}, "Deletes profile and creates a new one with the same name and new property values from provided options or an stdin") {} void TCommandReplaceProfile::Config(TConfig& config) { TCommandProfileCommon::Config(config); + config.Opts->AddLongOption('f', "force", "Never prompt").StoreTrue(&Force); config.SetFreeArgsMin(1); } @@ -1058,7 +1059,15 @@ void TCommandReplaceProfile::Parse(TConfig& config) { int TCommandReplaceProfile::Run(TConfig& config) { auto profileManager = CreateProfileManager(config.ProfileFile); - profileManager->RemoveProfile(ProfileName); + if (profileManager->HasProfile(ProfileName)) { + if (!Force) { + Cout << "Current profile will be replaced with a new one. All current profile data will be lost. Continue? (y/n): "; + if (!AskYesOrNo()) { + return EXIT_FAILURE; + } + } + profileManager->RemoveProfile(ProfileName); + } profileManager->CreateProfile(ProfileName); ConfigureProfile(ProfileName, profileManager, config, false, true); return EXIT_SUCCESS; diff --git a/ydb/public/lib/ydb_cli/commands/ydb_profile.h b/ydb/public/lib/ydb_cli/commands/ydb_profile.h index 9a81735c00..5272fc5985 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_profile.h +++ b/ydb/public/lib/ydb_cli/commands/ydb_profile.h @@ -137,6 +137,8 @@ public: virtual void Config(TConfig& config) override; virtual void Parse(TConfig& config) override; virtual int Run(TConfig& config) override; +private: + bool Force = false; }; } diff --git a/ydb/public/lib/ydb_cli/common/interactive.cpp b/ydb/public/lib/ydb_cli/common/interactive.cpp index 7226328ca4..4d8653661d 100644 --- a/ydb/public/lib/ydb_cli/common/interactive.cpp +++ b/ydb/public/lib/ydb_cli/common/interactive.cpp @@ -19,7 +19,7 @@ bool AskYesOrNo() { Cin >> input; if (to_lower(input) == "y" || to_lower(input) == "yes") { return true; - } else if (to_lower(input) == "n" || to_lower(input) == "n") { + } else if (to_lower(input) == "n" || to_lower(input) == "no") { return false; } else { Cout << "Type \"y\" (yes) or \"n\" (no): "; |