mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-10 01:10:09 +03:00
Add basic CLI commands #1847
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xoxys on GitHub.
It could be handy to have some basic CLI options for the
bitwarden_rsbinary in place. Minimum set could be something likebitwarden_rs --helpandbitwarden_rs --version.These CLI options can also be used to verify if the compiled binary is executable.
@tinywombat765 commented on GitHub:
I'd like to take this
@tinywombat765 commented on GitHub:
In that case I'd like to use structopt, which is built on top of clap but provides a nicer api imo
@tinywombat765 commented on GitHub:
@dani-garcia Do you have a preference as for as cli argument parsing is concerned?
@dani-garcia commented on GitHub:
Sure thing, have at it! If you need help I'm usually either here or the Matrix chat.
@dani-garcia commented on GitHub:
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
@dani-garcia commented on GitHub:
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.
@tinywombat765 commented on GitHub:
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?
@dani-garcia commented on GitHub:
For the version flag I'd just print
bitwarden_rsfollowed 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.
@dani-garcia commented on GitHub:
Closed because #888 got merged
@tinywombat765 commented on GitHub:
I opened a PR #888