question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not support upper case option.

See original GitHub issue
import click
@click.command()
@click.option('-act', default='start')
@click.option('-D', default=False)
def inout(D, act):
    print(D, act)

inout()

This code not work: Error: no such option: -d

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ThiefMastercommented, Apr 9, 2018

Since Python variables should be snake_case it makes sense for click to convert them to lowercase. You can override the name of the kwarg if you prefer something different.

1reaction
ThiefMastercommented, Apr 9, 2018

Generally, short (single-letter) options use a single dash, while long options use two dashes. Almost all command line tools do this.

Actually looking at your error again, you define -d but your option is named -D. Keep in mind that options are case sensitive!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change the capitalization or case of text - Microsoft Support
You can change the capitalization, or case, of selected text in a document by clicking a single button on the Home tab called...
Read more >
text-transform - CSS: Cascading Style Sheets - MDN Web Docs
The text-transform CSS property specifies how to capitalize an element's text. It can be used to make text appear in all-uppercase or ...
Read more >
User should be able to type in upper case without caps lock
Solved: Hi All, Is there any way to make filed by default upper case in catalog item. If user will type, all letters...
Read more >
How to Change Uppercase and Lowercase Text in Microsoft ...
In the menu bar, on the Home tab, click the Change Case icon, which has an uppercase 'A' and lowercase 'a.' Change Case...
Read more >
What code should be written to accept Lower and Upper case ...
Use the tolower function to convert your input to lowercase and then you will only need to worry about the lowercase options. ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found