You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Option name alias / custom option name mapping #725
This works, but the problem is that the max parameter shadows the built-in function. I would like to change the function parameter name, but I don't want to change the option name. Is there a way to change the mapping? (I read through the docs rather thoroughly and haven't found the answer.)
I would agree with @janpom about the documentation probably needing an example. I had this same problem today and first looked through the documentation and then the source code before finding this answer.
In my case I was trying to do @click.option("-a", "--all") which I think is a pretty common flag in CLIs and conflicts with the builtin all method.
Reacted by Randy Syring, Kun Zhou and Hugo van Kemenade
Activity
brrzap commentedon May 2, 2017
you can define the option with another name. the API documentation refers to these as
param_decls; see Options for examples.janpom commentedon May 2, 2017
Thanks @brrzap. It's great this is possible.
I still think the documentation is slightly lacking in this respect. The
param_declsdoesn't have any reference, so it doesn't help much.You're right that there's this example that does help, but it's not an obvious place to look at when looking for this information.
Anyway, thanks for the helpful response.
scottbelden commentedon May 17, 2017
I would agree with @janpom about the documentation probably needing an example. I had this same problem today and first looked through the documentation and then the source code before finding this answer.
In my case I was trying to do
@click.option("-a", "--all")which I think is a pretty common flag in CLIs and conflicts with the builtinallmethod.Merge #1576
Merge #37
Update click to 7.0 (#97)