diff options
| author | Dan Engelbrecht <[email protected]> | 2025-09-05 13:02:27 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-09-05 13:02:27 +0200 |
| commit | 45b0307d42b22e04cee63467a8fdb898a2d8d552 (patch) | |
| tree | 905b3eb62af89269be5b15f4c407d900ce86f7f3 /src/zen/cmds/wipe_cmd.cpp | |
| parent | Avoid mutating executable paths when copying files during full service instal... (diff) | |
| download | archived-zen-45b0307d42b22e04cee63467a8fdb898a2d8d552.tar.xz archived-zen-45b0307d42b22e04cee63467a8fdb898a2d8d552.zip | |
refactor zen command return value handling (#487)
- Improvement: Use consistent language for command line argument parsing errors
- Improvement: Changed zen command parsing errors to output help first and error last to make it easier to spot the error
- Improvement: Refactor zen command return codes to conform to valid Linux range (0-255)
kSuccess = 0,
kOtherError = 1,
kBadInput = 2,
kOutOfMemory = 16,
kOutOfDisk = 17,
kAssertError = 70,
kHttpOtherClientError = 80,
kHttpCantConnectError = 81,
kHttpNotFound = 66, // NotFound(404)
kHttpUnauthorized = 77, // Unauthorized(401),
kHttpSLLError = 82,
kHttpForbidden = 83, // Forbidden(403)
kHttpTimeout = 84, // RequestTimeout(408)
kHttpConflict = 85, // Conflict(409)
kHttpNoHost = 86,
kHttpOtherServerError = 90,
kHttpInternalServerError = 91, // InternalServerError(500)
kHttpServiceUnavailable = 69, // ServiceUnavailable(503)
kHttpBadGateway = 92, // BadGateway(502)
kHttpGatewayTimeout = 93, // GatewayTimeout(504)
Diffstat (limited to 'src/zen/cmds/wipe_cmd.cpp')
| -rw-r--r-- | src/zen/cmds/wipe_cmd.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/zen/cmds/wipe_cmd.cpp b/src/zen/cmds/wipe_cmd.cpp index 5a9d0174e..d2bc2f5c4 100644 --- a/src/zen/cmds/wipe_cmd.cpp +++ b/src/zen/cmds/wipe_cmd.cpp @@ -543,7 +543,7 @@ WipeCommand::WipeCommand() WipeCommand::~WipeCommand() = default; -int +void WipeCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) { ZEN_UNUSED(GlobalOptions); @@ -553,9 +553,9 @@ WipeCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) signal(SIGBREAK, SignalCallbackHandler); #endif // ZEN_PLATFORM_WINDOWS - if (!ZenCmdBase::ParseOptions(argc, argv)) + if (!ParseOptions(argc, argv)) { - return 0; + return; } Quiet = m_Quiet; @@ -567,7 +567,7 @@ WipeCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) if (!IsDir(m_Directory)) { - return 0; + return; } while (!m_Yes) @@ -583,13 +583,11 @@ WipeCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) } else if (Reponse == "n" || Reponse == "no") { - return 0; + return; } } CleanDirectory(m_Directory, {}, !m_KeepReadOnlyFiles, m_Dryrun); - - return 0; } } // namespace zen |