diff options
| author | Dan Engelbrecht <[email protected]> | 2023-01-13 07:08:02 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-01-13 07:08:02 -0800 |
| commit | 61f18d2de7f37aa03aa09d55562d05c6da033eb2 (patch) | |
| tree | 217828004ee4417b6f2be80a7bf778b808798e4d /zen/cmds/print.cpp | |
| parent | Add info (GET) endpoints for structured cache (#211) (diff) | |
| download | archived-zen-61f18d2de7f37aa03aa09d55562d05c6da033eb2.tar.xz archived-zen-61f18d2de7f37aa03aa09d55562d05c6da033eb2.zip | |
zen command line tool improvements (#212)
- Feature: zen command line tool `cache-info` to show cache, namespace or bucket info
- Feature: zen command line tool `project-info` to show store, project or oplog info
- Feature: zen command line tool `project-drop` to drop project or oplog
- Feature: zen command line tool `gc` to trigger a GC run
- Feature: zen command line tool `gc-info` to check status of GC
- Improvement: zen command line tool now fails on any unrecognized arguments
- Improvement: zen command line tool now displays extra help for all sub-commands
- Improvement: host address can now be configured for zen command line tool `drop` command
changelog
Diffstat (limited to 'zen/cmds/print.cpp')
| -rw-r--r-- | zen/cmds/print.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/zen/cmds/print.cpp b/zen/cmds/print.cpp index 067dc844a..67191605c 100644 --- a/zen/cmds/print.cpp +++ b/zen/cmds/print.cpp @@ -34,6 +34,7 @@ PrintCommand::PrintCommand() { m_Options.add_options()("h,help", "Print help"); m_Options.add_option("", "s", "source", "Object payload file", cxxopts::value(m_Filename), "<file name>"); + m_Options.parse_positional({"source"}); } PrintCommand::~PrintCommand() = default; @@ -41,16 +42,10 @@ PrintCommand::~PrintCommand() = default; int PrintCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) { - ZEN_UNUSED(GlobalOptions, argc, argv); - - m_Options.parse_positional({"source"}); + ZEN_UNUSED(GlobalOptions); - auto result = m_Options.parse(argc, argv); - - if (result.count("help")) + if (!ParseOptions(argc, argv)) { - std::cout << m_Options.help({"", "Group"}) << std::endl; - return 0; } @@ -153,6 +148,7 @@ PrintPackageCommand::PrintPackageCommand() { m_Options.add_options()("h,help", "Print help"); m_Options.add_option("", "s", "source", "Package payload file", cxxopts::value(m_Filename), "<file name>"); + m_Options.parse_positional({"source"}); } PrintPackageCommand::~PrintPackageCommand() @@ -162,16 +158,10 @@ PrintPackageCommand::~PrintPackageCommand() int PrintPackageCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) { - ZEN_UNUSED(GlobalOptions, argc, argv); - - m_Options.parse_positional({"source"}); + ZEN_UNUSED(GlobalOptions); - auto result = m_Options.parse(argc, argv); - - if (result.count("help")) + if (!ParseOptions(argc, argv)) { - std::cout << m_Options.help({"", "Group"}) << std::endl; - return 0; } |