fastapi / typer

Typer, build great CLIs. Easy to code. Based on Python type hints.
https://typer.tiangolo.com/
MIT License
15.52k stars 659 forks source link

Deprecate support for `is_flag` and `flag_value` parameters #986

Open svlandeg opened 3 weeks ago

svlandeg commented 3 weeks ago

Privileged issue

Issue Content

Typer's code base currently contains is_flag and flag_value parameters like Click does. However, the current behaviour is inconsistent with Click's behaviour, and not documented.

In discussion with @tiangolo, we've come to the conclusion that these parameters are pretty confusing overall to work with. There are essentially two defaults (one set in code, and one set by flag_value) and then an option to set an arbitrary value to something that is a "flag". We feel that any behaviour obtained by this combination of parameters can probably be achieved easily with some internal logic and more straightforward (and properly typed) options/arguments.

As such, we've decided to remove these options from the code base as they're not really functional right now anyway.

svlandeg commented 3 weeks ago

Related discussions: