[GH-ISSUE #816] Add basic CLI commands #570

Closed
opened 2026-03-03 01:30:38 +03:00 by kerem · 10 comments
Owner

Originally created by @xoxys on GitHub (Jan 16, 2020).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/816

It could be handy to have some basic CLI options for the bitwarden_rs binary in place. Minimum set could be something like bitwarden_rs --help and bitwarden_rs --version.

These CLI options can also be used to verify if the compiled binary is executable.

Originally created by @xoxys on GitHub (Jan 16, 2020). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/816 It could be handy to have some basic CLI options for the `bitwarden_rs` binary in place. Minimum set could be something like `bitwarden_rs --help` and `bitwarden_rs --version`. These CLI options can also be used to verify if the compiled binary is executable.
kerem 2026-03-03 01:30:38 +03:00
Author
Owner

@tinywombat765 commented on GitHub (Mar 2, 2020):

I'd like to take this

<!-- gh-comment-id:593433230 --> @tinywombat765 commented on GitHub (Mar 2, 2020): I'd like to take this
Author
Owner

@dani-garcia commented on GitHub (Mar 2, 2020):

Sure thing, have at it! If you need help I'm usually either here or the Matrix chat.

<!-- gh-comment-id:593539841 --> @dani-garcia commented on GitHub (Mar 2, 2020): Sure thing, have at it! If you need help I'm usually either here or the Matrix chat.
Author
Owner

@tinywombat765 commented on GitHub (Mar 2, 2020):

@dani-garcia Do you have a preference as for as cli argument parsing is concerned?

<!-- gh-comment-id:593575346 --> @tinywombat765 commented on GitHub (Mar 2, 2020): @dani-garcia Do you have a preference as for as cli argument parsing is concerned?
Author
Owner

@dani-garcia commented on GitHub (Mar 2, 2020):

Do you mean choice of library? If nothing has changed, clap is the most popular so I'd go that way.

https://github.com/clap-rs/clap

<!-- gh-comment-id:593577236 --> @dani-garcia commented on GitHub (Mar 2, 2020): Do you mean choice of library? If nothing has changed, clap is the most popular so I'd go that way. https://github.com/clap-rs/clap
Author
Owner

@tinywombat765 commented on GitHub (Mar 2, 2020):

In that case I'd like to use structopt, which is built on top of clap but provides a nicer api imo

<!-- gh-comment-id:593577827 --> @tinywombat765 commented on GitHub (Mar 2, 2020): In that case I'd like to use structopt, which is built on top of clap but provides a nicer api imo
Author
Owner

@dani-garcia commented on GitHub (Mar 2, 2020):

Ah, I thought the structopt api was merged into clap too, but apparently that's scheduled to be released on the next version of clap 3.0!

I agree the declarative api of structopt is nicer, I'd prefer to use that too.

<!-- gh-comment-id:593579909 --> @dani-garcia commented on GitHub (Mar 2, 2020): Ah, I thought the structopt api was merged into clap too, but apparently that's scheduled to be released on the next version of clap 3.0! I agree the declarative api of structopt is nicer, I'd prefer to use that too.
Author
Owner

@tinywombat765 commented on GitHub (Mar 2, 2020):

I see that if the GIT_VERSION environment var is set at compile time the app with print that as it's version. Should I use that for the version flag? If so what should it print if anything it that var is not set? And if not what should I print?

<!-- gh-comment-id:593584708 --> @tinywombat765 commented on GitHub (Mar 2, 2020): I see that if the GIT_VERSION environment var is set at compile time the app with print that as it's version. Should I use that for the version flag? If so what should it print if anything it that var is not set? And if not what should I print?
Author
Owner

@dani-garcia commented on GitHub (Mar 2, 2020):

For the version flag I'd just print bitwarden_rs followed by a space and the GIT_VERSION value if present. Similar to how cargo --version or rustc --version do it.

If no version is provided, you could print something like.

bitwarden_rs (Version info from Git not present)
<!-- gh-comment-id:593589845 --> @dani-garcia commented on GitHub (Mar 2, 2020): For the version flag I'd just print `bitwarden_rs` followed by a space and the GIT_VERSION value if present. Similar to how cargo --version or rustc --version do it. If no version is provided, you could print something like. ``` bitwarden_rs (Version info from Git not present) ```
Author
Owner

@tinywombat765 commented on GitHub (Mar 2, 2020):

I opened a PR #888

<!-- gh-comment-id:593594279 --> @tinywombat765 commented on GitHub (Mar 2, 2020): I opened a PR #888
Author
Owner

@dani-garcia commented on GitHub (Mar 2, 2020):

Closed because #888 got merged

<!-- gh-comment-id:593671687 --> @dani-garcia commented on GitHub (Mar 2, 2020): Closed because #888 got merged
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#570
No description provided.