-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option is lowercased upon decorating function #1052
Comments
I think this is expected behavior see this line in core.py I was able to replicate what you are seeing on MacOS on the current master branch of click. What specifically are you trying to accomplish? |
This is wholly undocumented. I see the line of code and that is how I figured out it wasn't me that was causing the problem - but it is no documented. I want camel casing of some of the arguments that I have - like "forceDeveloper" or "forceAll". |
I agree, it isn't explicitly documented, would you be interested in opening a documentation PR? Also you can provide a token normalization function to allow case insensitive command line options. import click
CONTEXT_SETTINGS = dict(token_normalize_func=lambda x: x.lower())
@click.command(context_settings=CONTEXT_SETTINGS)
@click.option("--someOption", help="Help text")
def test_fun(someoption):
print("Test print!")
if __name__ == "__main__":
test_fun() This would make all of the following work:
|
Resolved in #1055 |
pip list
Package Version
...
click 6.7
...
This will give an error:
As you can see, it expects the casing to be "someoption" - and not "someOption" as I specified it.
I'm running this on Windows 10 with Python 2.7.14 - could that be a factor?
The text was updated successfully, but these errors were encountered: