Skip to content

Use clap for CLI argument parsing #2993

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

Merged
merged 9 commits into from
Nov 2, 2020
Merged

Use clap for CLI argument parsing #2993

merged 9 commits into from
Nov 2, 2020

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Oct 31, 2020

This should make it easier to convert these binaries to clap subcommands in a follow-up PR. It also simplifies our argument parsing code and generates help messages and proper errors if the passed arguments don't match our expectations.

r? @jtgeibel

Copy link
Member

@jtgeibel jtgeibel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Just 1 copy paste bug noted below. Feel free to r=me.

Cargo.toml Outdated
@@ -34,6 +34,7 @@ base64 = "0.13"
cargo-registry-s3 = { path = "src/s3", version = "0.2.0" }
chrono = { version = "0.4.0", features = ["serde"] }
civet = "0.12.0-alpha.4"
clap = "3.0.0-beta.2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
clap = "3.0.0-beta.2"
clap = "=3.0.0-beta.2"

I'd pin the version since clap often introduces breaking changes in beta releases (https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) and we could avoid updating it by mistake.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable. I've changed it to pinned. 👍

@Turbo87
Copy link
Member Author

Turbo87 commented Nov 2, 2020

@bors r=jtgeibel

@bors
Copy link
Contributor

bors commented Nov 2, 2020

📌 Commit c1bc624 has been approved by jtgeibel

@bors
Copy link
Contributor

bors commented Nov 2, 2020

⌛ Testing commit c1bc624 with merge 3962b74...

@bors
Copy link
Contributor

bors commented Nov 2, 2020

☀️ Test successful - checks-travis
Approved by: jtgeibel
Pushing 3962b74 to master...

@bors bors merged commit 3962b74 into rust-lang:master Nov 2, 2020
@Turbo87 Turbo87 deleted the clap branch November 3, 2020 21:28
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.

5 participants