Skip to content

Commit

Permalink
Return a non-zero exit code when no subcommands are supplied (#296)
Browse files Browse the repository at this point in the history
## 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

<!--Explain the changes you've made to each file or major component.
This should help the reviewer understand your changes-->
<!--Also refer to any related changes or PRs in other repositories-->

- **`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)
  • Loading branch information
tangowithfoxtrot authored Oct 19, 2023
1 parent f51b5b9 commit 9ff37c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bws/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9ff37c7

Please sign in to comment.