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 clap to 4.3.9 #1767

Merged
merged 2 commits into from
Jun 28, 2023
Merged

Upgrade clap to 4.3.9 #1767

merged 2 commits into from
Jun 28, 2023

Conversation

martinvonz
Copy link
Owner

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (src/config-schema.json)
  • I have added tests to cover my changes

If we fail to parse the command line, even with `ignore_errors(true)`
set, we currently let clap exit the process for us because we call
`get_matches_from()`. We should instead propagate any errors and
exit in `CliRunner::run()` as usual..
The new version has a change that makes `ignore_errors()` not ignore
the error from `--help` (clap handles `--help` by returning an
error). To compensate for that, I disabled the `--help` and
`--version` flag and the `help` subcommand while parsing early
arguments.
@martinvonz martinvonz requested a review from chooglen June 28, 2023 20:38
Copy link
Collaborator

@chooglen chooglen left a comment

Choose a reason for hiding this comment

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

LGTM. I wonder why clap decided to change the way ignore_errors() works.

src/cli_util.rs Show resolved Hide resolved
src/cli_util.rs Show resolved Hide resolved
@martinvonz martinvonz merged commit 68e696d into main Jun 28, 2023
14 checks passed
@martinvonz martinvonz deleted the push-vnxuyunrqrqx branch June 28, 2023 21:22
@martinvonz
Copy link
Owner Author

LGTM. I wonder why clap decided to change the way ignore_errors() works.

It was clap-rs/clap#4988. I didn't read enough to understand it.

@chooglen
Copy link
Collaborator

I've read all the comments and still don't understand it :)

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