diff options
| author | Dan Engelbrecht <[email protected]> | 2024-10-16 09:49:04 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-10-16 09:49:04 +0200 |
| commit | 86a9271d8f695ca292512025833f220876bf50ed (patch) | |
| tree | a7746278be39b06d34989cf09e9956a2d4315263 | |
| parent | make sure to initialize stats in file, jupiter and zen remote stores (#198) (diff) | |
| download | zen-86a9271d8f695ca292512025833f220876bf50ed.tar.xz zen-86a9271d8f695ca292512025833f220876bf50ed.zip | |
add --dryrun instructions to projectstore drop (#199)
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | src/zen/cmds/projectstore_cmd.cpp | 24 |
2 files changed, 16 insertions, 9 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 10e8366dd..e073ab78d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Oplog entry view is more complete - Separate page for inspecting server stats - Improvement: When batch-fetching cache values/attachments, only use block memory-buffering for items that may be memcached to reduce disk I/O +- Improvement: `zen project-drop` command defaults to dry-run to prevent accidental drop and provides information on how to actually perform the drop - Bugfix: Parse filenames as utf8 string when mirroring files inside an oplog using `zen oplog-mirror` and `zen vfs` - Bugfix: Properly initialize stats for file/jupiter/zen remote project store - fixes stats log output when exporting and importing oplogs - Cleanup: Removed GCv1 implementation diff --git a/src/zen/cmds/projectstore_cmd.cpp b/src/zen/cmds/projectstore_cmd.cpp index 0f10f2743..8573c36aa 100644 --- a/src/zen/cmds/projectstore_cmd.cpp +++ b/src/zen/cmds/projectstore_cmd.cpp @@ -432,9 +432,13 @@ DropProjectCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** arg if (m_OplogName.empty()) { - ZEN_CONSOLE("{} project '{}' from '{}'", m_DryRun ? "Would drop" : "Dropping", m_ProjectName, m_HostName); - if (!m_DryRun) + if (m_DryRun) { + ZEN_CONSOLE("Would drop project '{}' from '{}'. Use --dryrun=false to execute the drop operation.", m_ProjectName, m_HostName); + } + else + { + ZEN_CONSOLE("Dropping project '{}' from '{}'", m_ProjectName, m_HostName); if (HttpClient::Response Result = Http.Delete(fmt::format("/prj/{}", m_ProjectName))) { ZEN_CONSOLE("{}", Result); @@ -453,14 +457,16 @@ DropProjectCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** arg { return 1; } - ZEN_CONSOLE("{} oplog '{}/{}' from '{}'{}", - m_DryRun ? "Would drop" : "Dropping", - m_ProjectName, - m_OplogName, - m_HostName, - m_DryRun ? ". Add --dryrun=false to execute the drop"sv : ""sv); - if (!m_DryRun) + if (m_DryRun) + { + ZEN_CONSOLE("Would drop oplog '{}/{}' from '{}'. Add --dryrun=false to execute the drop operation.", + m_ProjectName, + m_OplogName, + m_HostName); + } + else { + ZEN_CONSOLE("Dropping oplog '{}/{}' from '{}'", m_ProjectName, m_OplogName, m_HostName); if (HttpClient::Response Result = Http.Delete(fmt::format("/prj/{}/oplog/{}", m_ProjectName, m_OplogName))) { ZEN_CONSOLE("{}", Result); |