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

Upgrade to clap for argument parsing #29

Closed
wants to merge 1 commit into from

Conversation

nick42d
Copy link

@nick42d nick42d commented Aug 3, 2024

As mentioned on #28, command line arguments could use an overhaul, so kicking it off with an upgrade to clap since gumdrop seems to be no longer maintained.

I set this up to break as little as possible existing behaviour, if we are willing to change the version flag to clap default -V from -v it removes the need to have a version arg also.

Output of cargo-aur --help - Old

Usage: /home/nickd/.cargo/bin/cargo-aur [OPTIONS]

Positional arguments:
  free                 Absorbs any extra junk arguments.

Optional arguments:
  -h, --help           Display this help message.
  -v, --version        Display the current version of this software.
  -o, --output OUTPUT  Set a custom output directory (default: target/).
  -m, --musl           Use the MUSL build target to produce a static binary.
  -d, --dryrun         Don't actually build anything.

Output of cargo-aur --help - New

Prepare Rust projects to be released on the Arch Linux User Repository.

Usage: cargo-aur [OPTIONS]

Options:
  -o, --output <OUTPUT>  Set a custom output directory (default: target/)
  -m, --musl             Use the MUSL build target to produce a static binary
  -d, --dryrun           Don't actually build anything
  -v, --version          Print version
  -h, --help             Print help

@fosskers
Copy link
Owner

fosskers commented Aug 4, 2024

Thanks for this. I know that gumdrop doesn't see much activity, but clap is a massive dependency and the needs of cargo aur are fairly simple. As-is, this increases the binary size by about 65%, so I'm leaning towards not including this. What do you think?

@nick42d
Copy link
Author

nick42d commented Aug 4, 2024

Your call here, binary size is not a personal concern for me but understood for some it is.

@fosskers
Copy link
Owner

fosskers commented Aug 4, 2024

clap is otherwise an excellent tool and I use it elsewhere, but in this case I think it doesn't buy us much. Although I'm going to close this, thanks for the effort.

@fosskers fosskers closed this Aug 4, 2024
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