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

Use hyphens in long CLI flags to be consistent with GNU utils #2

Merged
merged 2 commits into from
Nov 9, 2021

Conversation

tranzystorekk
Copy link
Contributor

@tranzystorekk tranzystorekk commented Oct 10, 2021

Highlights:

  • Switches word separator for flags from underscores _ to hyphens - making long flags POSIX (--use_working_dir ➡️ --use-working-dir)
  • Uses .visible_alias(...) so that clap documents aliases automatically

For formatting, a github action can be set up that doesn't allow merging unformatted code.

@tranzystorekk
Copy link
Contributor Author

@dimo414 I'm guessing you haven't had the time to review these changes, either way I'd like to thank you for welcoming me as a contributor 😄

@dimo414
Copy link
Owner

dimo414 commented Oct 25, 2021

Yes sorry for the delay, it's just a large PR and I haven't made time to look through it. Will do so soon.

src/main.rs Outdated Show resolved Hide resolved
@dimo414
Copy link
Owner

dimo414 commented Nov 9, 2021

Ah, I didn't realize the bulk of this PR was just cargo fmt, and I had been delaying reviewing it until I could go through your changes in detail.

I appreciate the motivation for using a formatter, but I'd intentionally not run cargo fmt on the project so far. I might decide to set up formatting in the future but at a minimum I'd want to add enforcement and probably also tune the formatter via a rustfmt.toml as well.

The changes in 697f209 LG though, so if you want to remove the cargo fmt commit I can merge that.

@tranzystorekk
Copy link
Contributor Author

@dimo414 agreed, I just reset the formatting commit :)

@dimo414 dimo414 changed the title Refactor long CLI flags and reformat code Use hyphens in long CLI flags to be consistent with GNU utils Nov 9, 2021
@dimo414 dimo414 merged commit 6c40865 into dimo414:master Nov 9, 2021
@tranzystorekk tranzystorekk deleted the flags-and-cleanup branch November 9, 2021 18:55
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.

2 participants