eonu / feud

Build powerful CLIs with simple idiomatic Python, driven by type hints. Not all arguments are bad.
https://feud.readthedocs.io
MIT License
57 stars 2 forks source link

Should positional parameters convert into both arguments and options? #152

Open eonu opened 2 months ago

eonu commented 2 months ago

Does this suggestion already exist?

Feature description

Currently in a function signature such as f(a: int, *, b: str | None = None), a is converted into a click.Argument.

Should it instead specify a as both:

In which case, f(a: int, /, *, b: str | None = None) would be used to indicate that a is argument-only.


Click seems to only allow a parameter to exist as an argument or option (and not both), and personally I think it gets confusing if it is allowed, but this can probably done with some argument parsing tricks.