Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SM-774: Write Help Text to 'stderr' When No Args Are Provided #190

Merged
merged 5 commits into from Sep 6, 2023

Conversation

coltonhurst
Copy link
Member

@coltonhurst coltonhurst commented Aug 25, 2023

Type of change

- [ ] Bug fix
- [ ] New feature development
- [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

When no arguments are provided to bws, we should write the help text to stderr rather than stdout to be consistent with the existing bws subcommand behavior.

Potentially relevant clap GitHub discussions:

Code changes

  • main.rs: Print with eprintln

Before you submit

  • Please add unit tests where it makes sense to do so (encouraged but not required)

@coltonhurst coltonhurst self-assigned this Aug 25, 2023
@bitwarden-bot
Copy link

bitwarden-bot commented Aug 25, 2023

Logo
Checkmarx One – Scan Summary & Detailse5847bdf-e3dc-447e-8baf-f6f903f5d2e4

No New Or Fixed Issues Found

@Hinton
Copy link
Member

Hinton commented Aug 28, 2023

I think this changes bws to be more consistent with bws subcommand. So from that perspective I'm fine with this change. We don't want to change --help though.

@dani-garcia any thoughts?

We should document this in the changelog though. Not sure if this qualifies as a breaking change, I have a hard time imagining someone depending on the stdout output when not using any commands.

crates/bws/src/main.rs Outdated Show resolved Hide resolved
@coltonhurst
Copy link
Member Author

I think this changes bws to be more consistent with bws subcommand. So from that perspective I'm fine with this change. We don't want to change --help though.

@dani-garcia any thoughts?

We should document this in the changelog though. Not sure if this qualifies as a breaking change, I have a hard time imagining someone depending on the stdout output when not using any commands.

Yes, this should unify our output to stderr in these cases, with the exception when --help is provided.

I have updated the changelog in 669db02.

@coltonhurst coltonhurst marked this pull request as ready for review August 28, 2023 16:00
@coltonhurst coltonhurst merged commit 19d7f2f into master Sep 6, 2023
40 checks passed
@coltonhurst coltonhurst deleted the sm/sm-774 branch September 6, 2023 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants