diff options
| author | Dan Engelbrecht <[email protected]> | 2024-10-03 17:15:58 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-10-03 17:15:58 +0200 |
| commit | 47e27cbe2aa1e1d6eff28f8f46f92044614f909c (patch) | |
| tree | dcd4d23311ba1264ae39af8f494afff3f10e7b55 /src/zen/cmds/cache_cmd.cpp | |
| parent | remove gc v1 (#121) (diff) | |
| download | archived-zen-47e27cbe2aa1e1d6eff28f8f46f92044614f909c.tar.xz archived-zen-47e27cbe2aa1e1d6eff28f8f46f92044614f909c.zip | |
improve naming and feedback in zen commands (#185)
* rename cache-get opton attachmentid -> attachmenthash for improved clarity
* add help info for --dry-run in DropProjectCommand
Diffstat (limited to 'src/zen/cmds/cache_cmd.cpp')
| -rw-r--r-- | src/zen/cmds/cache_cmd.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/zen/cmds/cache_cmd.cpp b/src/zen/cmds/cache_cmd.cpp index d6fec3b12..bf5f308e1 100644 --- a/src/zen/cmds/cache_cmd.cpp +++ b/src/zen/cmds/cache_cmd.cpp @@ -525,14 +525,14 @@ CacheGetCommand::CacheGetCommand() m_Options.add_option("", "v", "valuekey", "Cache entry iohash id", cxxopts::value(m_ValueKey), "<valuekey>"); m_Options.add_option("", "a", - "attachmentid", - "For a cache entry record, get a particular attachment based on IoHash", - cxxopts::value(m_AttachmentId), - "<attachmentid>"); + "attachmenthash", + "For a cache entry record, get a particular attachment based on the 'RawHash'", + cxxopts::value(m_AttachmentHash), + "<attachmenthash>"); m_Options.add_option("", "o", "output-path", "File path for output data", cxxopts::value(m_OutputPath), "<path>"); m_Options.add_option("", "t", "text", "Ouput content of cache entry record as text", cxxopts::value(m_AsText), "<text>"); - m_Options.parse_positional({"namespace", "bucket", "valuekey", "attachmentid"}); - m_Options.positional_help("namespace bucket valuekey attachmentid"); + m_Options.parse_positional({"namespace", "bucket", "valuekey", "attachmenthash"}); + m_Options.positional_help("namespace bucket valuekey attachmenthash"); } CacheGetCommand::~CacheGetCommand() = default; @@ -578,11 +578,11 @@ CacheGetCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) } IoHash AttachmentHash; - if (!m_AttachmentId.empty()) + if (!m_AttachmentHash.empty()) { - if (!IoHash::TryParse(m_AttachmentId, AttachmentHash)) + if (!IoHash::TryParse(m_AttachmentHash, AttachmentHash)) { - throw zen::OptionParseException("cache-get --attachmentid option requires a valid IoHash string"); + throw zen::OptionParseException("cache-get --attachmenthash option requires a valid IoHash string"); } } @@ -594,7 +594,7 @@ CacheGetCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) TargetPath = std::filesystem::path(m_OutputPath); if (std::filesystem::is_directory(TargetPath)) { - TargetPath = TargetPath / (m_AttachmentId.empty() ? m_ValueKey : m_AttachmentId); + TargetPath = TargetPath / (m_AttachmentHash.empty() ? m_ValueKey : m_AttachmentHash); } else { @@ -603,7 +603,7 @@ CacheGetCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) } if (TargetPath.empty()) { - TargetPath = (m_AttachmentId.empty() ? m_ValueKey : m_AttachmentId); + TargetPath = (m_AttachmentHash.empty() ? m_ValueKey : m_AttachmentHash); } std::string Url = fmt::format("/z$/{}/{}/{}", m_Namespace, m_Bucket, m_ValueKey); |