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.

Command `short_help` is ignored

See original GitHub issue

Hi @ewels, I came across another discrepancy between click and rich-click that’s giving me a little trouble: how command short help is handled.

click generates short help from the first sentence of the command’s help unless short_help is explicitly passed to the command, in which case that will be used. rich-click seems to use the first paragraph instead, and you can’t overwrite it using short_help.

Here’s a minimum reproducible example using rich-click==1.2.0.

@click.group()
def foo():
    """
    Help for group.
    """
    pass

@foo.command()
def command():
    """
    Help for command. This sentence shouldn't be included in the short help.
    """
    pass

@foo.command(short_help="This won't be used by rich-click")
def command2():
    """
    This should be overwritten by the explicitly passed short-help.
    """
    pass

Output of foo --help using click:

image

And using rich-click:

image

Thanks again for making rich-click!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ewelscommented, Mar 2, 2022
1reaction
aazuspancommented, Mar 2, 2022

Works perfectly. Thanks again @ewels!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pytest exit codes for command line errors look incorrect #3913
This line seems to be the culprit. argparse.ArgumentParser.error exits with status code 2. One possible solution is to override the error ...
Read more >
API — Click Documentation (8.1.x)
Instructs click to ignore options that a command does not understand and will store it on the context for later processing. This is...
Read more >
Python command line arguments ignored for standard user ...
I'm trying to run a Python script from the command line in Windows 7, but the interpreter seems to ignore all commend line...
Read more >
Command Line Options
Taylor support the following command line options. Usage: . ... Note: If the -header flag is not used, this flag is ignored. ......
Read more >
ReFrame Command Line Reference - Read the Docs
The reframe command is part of ReFrame's frontend. ... Ignore tests with conflicting names when loading. ... Print a short help message and...
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