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

Add basic CLI commands #816

Closed
xoxys opened this issue Jan 16, 2020 · 10 comments
Closed

Add basic CLI commands #816

xoxys opened this issue Jan 16, 2020 · 10 comments
Labels
good first issue Good for newcomers

Comments

@xoxys
Copy link
Contributor

xoxys commented Jan 16, 2020

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.

@dani-garcia dani-garcia added the good first issue Good for newcomers label Jan 18, 2020
@tinywombat765
Copy link

I'd like to take this

@dani-garcia
Copy link
Owner

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

@tinywombat765
Copy link

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

@dani-garcia
Copy link
Owner

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

@tinywombat765
Copy link

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

@dani-garcia
Copy link
Owner

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
Copy link

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
Copy link
Owner

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)

@tinywombat765
Copy link

I opened a PR #888

@dani-garcia
Copy link
Owner

Closed because #888 got merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants