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

fix: Don't bypass conflicts when using requires #4523

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Nov 29, 2022

  1. test: Add failing test for issue clap-rs#4520

    This test is semantically equivalent to the situation described in that
    issue's description:
    a first option conflicts with a second option.
    a third option requires the second option.
    Clap lets us provide the first and the third options only, which
    shouldn't be allowed.
    
    The test fails here, but is fixed by the next commit in this PR.
    pierrechevalier83 committed Nov 29, 2022
    Configuration menu
    Copy the full SHA
    2c51d8f View commit details
    Browse the repository at this point in the history
  2. fix: Don't bypass conflicts when using requires

    The intent for `is_missing_required_ok` is to allow a situation where
    two args are required, but they're part of the same group, or one
    overrides the other, which is equivalent, so having either of them is
    good enough.
    
    The way it was implemented, by reusing `gather_conflicts` introduced a
    loophole where `required` could be bypassed when it shouldn't.
    
    Fixes clap-rs#4520
    pierrechevalier83 committed Nov 29, 2022
    Configuration menu
    Copy the full SHA
    de00ad7 View commit details
    Browse the repository at this point in the history