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:
an argument, e.g. python f.py 2,
an option, e.g. python f.py --a 2.
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.
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 aclick.Argument
.Should it instead specify
a
as both:python f.py 2
,python f.py --a 2
.In which case,
f(a: int, /, *, b: str | None = None)
would be used to indicate thata
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.