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

PHD: use clap for more cargo xtask phd args #645

Merged
merged 2 commits into from
Feb 15, 2024
Merged

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Feb 15, 2024

Currently, cargo xtask phd does a bunch of "bash-style" arg parsing, looping over any unrecognized arguments. This was intended as a way of passing through arguments to phd-runner. However, because clap will stick any unrecognized arguments in trailing_var_args, we can just use normal clap arg parsing to handle the arguments that we default before passing through to phd-runner.

Now, the cargo xtask phd command has nicer help text for its overridden arguments, and it can use clap's built-in validation of conflicting arguments. This seems nicer.

Verified

This commit was signed with the committer’s verified signature.
hawkw Eliza Weisman
Currently, `cargo xtask phd` does a bunch of "bash-style" arg parsing,
looping over any unrecognized arguments. This was intended as a way of
passing through arguments to `phd-runner`. However, because `clap` will
stick any unrecognized arguments in `trailing_var_args`, we can just use
normal `clap` arg parsing to handle the arguments that we default before
passing through to `phd-runner`.

Now, the `cargo xtask phd` command has nicer help text for its
overridden arguments, and it can use `clap`'s built-in validation of
conflicting arguments. This seems nicer.
@hawkw hawkw requested a review from gjcolombo February 15, 2024 18:39

Verified

This commit was signed with the committer’s verified signature.
hawkw Eliza Weisman
@hawkw hawkw requested a review from gjcolombo February 15, 2024 19:53
@hawkw hawkw merged commit ffaf0fb into master Feb 15, 2024
10 checks passed
@hawkw hawkw deleted the eliza/nicer-xtask-cli branch February 15, 2024 21:00
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.

None yet

2 participants