diff options
| author | Dan Engelbrecht <[email protected]> | 2025-11-25 16:45:46 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-11-25 16:45:46 +0100 |
| commit | 79d9c0c6e717e6becd0173e6621d70398ae36f9f (patch) | |
| tree | 76b4ba6e121b85c8a0ab3c39310892b79878c058 /src | |
| parent | logging improvements (#664) (diff) | |
| download | zen-79d9c0c6e717e6becd0173e6621d70398ae36f9f.tar.xz zen-79d9c0c6e717e6becd0173e6621d70398ae36f9f.zip | |
remove 'auto' option for zen builds download (#665)
Diffstat (limited to 'src')
| -rw-r--r-- | src/zen/cmds/builds_cmd.cpp | 54 | ||||
| -rw-r--r-- | src/zen/cmds/builds_cmd.h | 2 |
2 files changed, 4 insertions, 52 deletions
diff --git a/src/zen/cmds/builds_cmd.cpp b/src/zen/cmds/builds_cmd.cpp index 665676fcd..7060f092a 100644 --- a/src/zen/cmds/builds_cmd.cpp +++ b/src/zen/cmds/builds_cmd.cpp @@ -268,29 +268,6 @@ namespace { static bool IsQuiet = false; static ProgressBar::Mode ProgressMode = ProgressBar::Mode::Pretty; - enum EAppendNewContentMode - { - Replace, - Auto, - Append, - Invalid - }; - - EAppendNewContentMode AppendNewContentModeFromString(const std::string_view ModeString) - { - switch (HashStringAsLowerDjb2(ModeString)) - { - case HashStringDjb2("false"): - return EAppendNewContentMode::Replace; - case HashStringDjb2("auto"): - return EAppendNewContentMode::Auto; - case HashStringDjb2("true"): - return EAppendNewContentMode::Append; - default: - return EAppendNewContentMode::Invalid; - } - } - #define ZEN_CONSOLE_VERBOSE(fmtstr, ...) \ if (IsVerbose) \ { \ @@ -2476,10 +2453,8 @@ BuildsCommand::BuildsCommand() "append", "Decides if the remote data should replace or append to the current local data.\n" " false = the local content will be replaced by the remote content\n" - " auto = if no path wildcards are given the local content will be replaced, if wildcards are given the " - "remote data will complement the local data\n" " true = the remote data will be overlayed on top of local data\n" - "Defaults to 'auto'.", + "Defaults to false.", cxxopts::value(m_AppendNewContent), "<append>"); }; @@ -3699,15 +3674,6 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) return Mode; }; - auto ParseAppendNewContent = [&]() -> EAppendNewContentMode { - EAppendNewContentMode Mode = AppendNewContentModeFromString(m_AppendNewContent); - if (Mode == EAppendNewContentMode::Invalid) - { - throw OptionParseException(fmt::format("'--append' ('{}') is invalid", m_AppendNewContent), SubOption->help()); - } - return Mode; - }; - if (SubOption == &m_DownloadOptions) { if (!IsQuiet) @@ -3771,22 +3737,8 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) std::vector<std::string> BuildPartNames = ParseBuildPartNames(); EPartialBlockRequestMode PartialBlockRequestMode = ParseAllowPartialBlockRequests(); - EAppendNewContentMode AppendNewContentMode = ParseAppendNewContent(); - - bool AppendNewContent = AppendNewContentMode == EAppendNewContentMode::Append; - if (AppendNewContentMode == EAppendNewContentMode::Auto) - { - if (IncludeWildcards.empty() && ExcludeWildcards.empty()) - { - AppendNewContent = false; - } - else - { - AppendNewContent = true; - } - } - if (AppendNewContent && m_Clean) + if (m_AppendNewContent && m_Clean) { throw OptionParseException("'--append' conflicts with '--clean'", SubOption->help()); } @@ -3811,7 +3763,7 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) .ExcludeWildcards = ExcludeWildcards, .MaximumInMemoryPayloadSize = GetMaxMemoryBufferSize(m_BoostWorkerMemory), .PopulateCache = m_UploadToZenCache, - .AppendNewContent = AppendNewContent}); + .AppendNewContent = m_AppendNewContent}); if (AbortFlag) { diff --git a/src/zen/cmds/builds_cmd.h b/src/zen/cmds/builds_cmd.h index db8826cba..24e2e30e4 100644 --- a/src/zen/cmds/builds_cmd.h +++ b/src/zen/cmds/builds_cmd.h @@ -67,7 +67,7 @@ private: std::string m_BuildPartId; // Defaults to a generated id when creating part, looked up when downloading using m_BuildPartName bool m_Clean = false; bool m_Force = false; - std::string m_AppendNewContent = "auto"; + bool m_AppendNewContent = false; uint8_t m_BlockReuseMinPercentLimit = 85; bool m_AllowMultiparts = true; std::string m_AllowPartialBlockRequests = "mixed"; |