From 9ff37c721d1056f48c8954f70c57e76d853f8139 Mon Sep 17 00:00:00 2001 From: tangowithfoxtrot <5676771+tangowithfoxtrot@users.noreply.github.com> Date: Thu, 19 Oct 2023 08:39:53 -0700 Subject: [PATCH] Return a non-zero exit code when no subcommands are supplied (#296) ## Type of change - [x] Bug fix - [ ] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective Return a non-zero exit code when no subcommands are supplied. This matches the behavior in many other CLIs (`bw`, `git`, `ssh`, etc.). ## Code changes - **`crates/bws/src/main.rs`:** Exit with a non-zero exit code ## Before you submit - Please add **unit tests** where it makes sense to do so (encouraged but not required) --- crates/bws/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bws/src/main.rs b/crates/bws/src/main.rs index 5e6da19d8..c7a910260 100644 --- a/crates/bws/src/main.rs +++ b/crates/bws/src/main.rs @@ -247,7 +247,7 @@ async fn process_commands() -> Result<()> { let Some(command) = cli.command else { let mut cmd = Cli::command(); eprintln!("{}", cmd.render_help().ansi()); - return Ok(()); + std::process::exit(1); }; // These commands don't require authentication, so we process them first