Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Disallow use of is_flag and multiple in options #2248

Merged
merged 1 commit into from
Apr 28, 2022

Conversation

amyreese
Copy link
Contributor

@amyreese amyreese commented Apr 5, 2022

Raises a TypeError similar to when specifying both count=True and is_flag=True.

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

@davidism davidism added this to the 8.1.3 milestone Apr 5, 2022
@davidism davidism merged commit 5fd87bd into pallets:8.1.x Apr 28, 2022
@0xDEC0DE
Copy link
Contributor

0xDEC0DE commented May 11, 2022

This ends up being a breaking change, .

For instance:

@click.command
@click.option('-p', '--project', 'project', envvar='PROJECT', multiple=True)
@click.option('--all-projects', '--all', 'project', envvar='PROJECT', flag_value='all', multiple=True)
def main(project):
    ...

...has been a convenient way to provide an "all projects" shortcut in my software for years, and now it's broken with little-to-no notice.

@juledwar
Copy link

juledwar commented May 11, 2022

Agreed.

@pallets pallets locked and limited conversation to collaborators May 12, 2022
@amyreese amyreese deleted the 8.1.x branch April 9, 2023 19:42
@davidism
Copy link
Member

davidism commented Jul 3, 2023

Removed the error and set default=True instead in #2550. The example from @0xDEC0DE and other issues should be addressed by that.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants