From 19d7f2f46175263c1ad69a63a2bde4766ee411b8 Mon Sep 17 00:00:00 2001 From: Colton Hurst Date: Wed, 6 Sep 2023 12:40:41 -0400 Subject: [PATCH] SM-774: Write Help Text to 'stderr' When No Args Are Provided (#190) * SM-774: Write help text to stderr on no args * SM-774: Add styling to output change * SM-774: Update the changelog --- crates/bws/CHANGELOG.md | 1 + crates/bws/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/bws/CHANGELOG.md b/crates/bws/CHANGELOG.md index 65568c6c2..a0a16f745 100644 --- a/crates/bws/CHANGELOG.md +++ b/crates/bws/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Support for shell autocompletion with the `bws completions` command (#103) +- When running `bws` with no args, the help text is now printed to `stderr` instead of `stdout` to be consistent with `bws subcommand` behavior (#190) ## [0.3.0] - 2023-07-26 diff --git a/crates/bws/src/main.rs b/crates/bws/src/main.rs index ab0c9afb2..5e6da19d8 100644 --- a/crates/bws/src/main.rs +++ b/crates/bws/src/main.rs @@ -246,7 +246,7 @@ async fn process_commands() -> Result<()> { let Some(command) = cli.command else { let mut cmd = Cli::command(); - cmd.print_help()?; + eprintln!("{}", cmd.render_help().ansi()); return Ok(()); };