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

Change clap bounds for Command from Parser to FromArgMatches #634

Merged
merged 1 commit into from
Feb 9, 2022

Conversation

tony-iqlusion
Copy link
Member

Clap has a separate Subcommand trait which is used instead of Parser on enums which represent subcommands.

For that reason Command can't directly bound on Parser and still be usable for subcommand enums.

Instead this commit changes Command to bound on the more general clap::FromArgMatches trait and moves the clap::Parser bound to the relevant methods for parsing toplevel arguments such as parse_args and parse_env_args.

Clap has a separate `Subcommand` trait which is used instead of `Parser`
on enums which represent subcommands.

For that reason `Command` can't directly bound on `Parser` and still be
usable for subcommand enums.

Instead this commit changes `Command` to bound on the more general
`clap::FromArgMatches` trait and moves the `clap::Parser` bound to the
relevant methods for parsing toplevel arguments such as `parse_args` and
`parse_env_args`.
@tony-iqlusion tony-iqlusion requested a review from a team January 18, 2022 22:55
@tony-iqlusion
Copy link
Member Author

Going to try this out on a local TMKMS branch and see if it fixes the problem

@tony-iqlusion
Copy link
Member Author

Finally managed to get TMKMS compiled/working

@tony-iqlusion tony-iqlusion merged commit 7c9ab79 into main Feb 9, 2022
@tony-iqlusion tony-iqlusion deleted the clap-command-bounds-fixes branch February 9, 2022 21:37
@tony-iqlusion tony-iqlusion mentioned this pull request Feb 11, 2022
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