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

Remove unnecessary unwraps in CLIs by using subcommand() #2124

Merged
merged 1 commit into from
Dec 2, 2021

Conversation

mdevlamynck
Copy link
Contributor

Part of #2046.

Replace subcommand_name() and subcommand_matches() with a single subcommand() to avoid redundant Option unwraping.

We may want to wait for the 3.0.0 release of clap since the return value of subcommand() changed between 3.0.0-beta-1 and 3.0.0-beta-2, I'm not sure how stable the api is.

Copy link
Contributor

@bhansconnect bhansconnect left a comment

Choose a reason for hiding this comment

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

Thanks. Using subcommand looks great. Even if the api changes as we update clap, we can deal with that in the update PRs.

@bhansconnect bhansconnect merged commit df5c7fb into trunk Dec 2, 2021
@bhansconnect bhansconnect deleted the clean-unwrap branch December 2, 2021 17:15
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