diff options
author | Albin Suresh <albin.suresh@softwareag.com> | 2022-03-15 23:53:09 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-15 23:53:09 +0530 |
commit | d7aefed3626a62d2d54b9e5fd291e5f43a49e9d1 (patch) | |
tree | 9798ab69435dd7352b38f58f5866cc50a2f4761e | |
parent | 5d064c6eef91d93b59afc024b51103d11de24ab8 (diff) | |
parent | 9d5139c495eb5f559259476671c6ddf52f71f36c (diff) |
Merge PR #1001 Fix apama plugin update-list command exit code
Fix apama plugin update-list command exit code
-rw-r--r-- | plugins/tedge_apama_plugin/src/main.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/tedge_apama_plugin/src/main.rs b/plugins/tedge_apama_plugin/src/main.rs index 6a75e6e5..9614e6f3 100644 --- a/plugins/tedge_apama_plugin/src/main.rs +++ b/plugins/tedge_apama_plugin/src/main.rs @@ -300,7 +300,13 @@ fn run_cmd(cmd: &str, args: &str) -> Result<(), InternalError> { fn main() { // On usage error, the process exits with a status code of 1 - let apama = ApamaCli::parse(); + let apama = match ApamaCli::try_parse() { + Ok(apamacli) => apamacli, + Err(_e) => { + // re-write the clap exit_status from 2 to 1, if parse fails + std::process::exit(1) + } + }; match run(apama.operation) { Ok(()) => { |