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.

`click.Command` option `hidden=True` is ignored

See original GitHub issue

click.Command in Click 8.1 has a option hidden=True to make the command hidden from help message, which is similar to the behavior like hidden argument in click.Option.

While hidden=True works well with click command option, it is ignored when commands have this option. All commands with this option are shown in help message.

This symptom is always reproducible.

Thanks

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lgprobertcommented, Apr 27, 2022

Glad that can do some help. This project is awesome!

1reaction
lgprobertcommented, Apr 27, 2022

After looking into source codes in core.py from click and compare to the rich_format_help() method from rich_click.py, I believe this issue can be easily solved by adding below lines to line 477 of rich_click.py:

          if cmd.hidden:
                continue

The above lines are copied from MultiCommand.format_commands() from core.py.

Hope this can save some time to fix this issue and have a new fix release sooner as this is quite useful.

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python click: Make some options hidden
I have several options to the command I'm defining, and I want some of them to be hidden in --help . How can...
Read more >
API — Click Documentation (8.1.x)
All positional arguments are passed as parameter declarations to Option ... the return value is always None and require_save and extension are ignored....
Read more >
Chapter01 Getting Started Click
Run the script with the help flag to verify the information: $ python ssh-medic.py -h Usage: ssh-medic.py [OPTIONS] COMMAND [ARGS]... Ensure ...
Read more >
CommandLine.Option (picocli 4.7.0 API)
In the case of command methods (annotated with @Command ), command ... Set hidden=true if this option should not be included in the...
Read more >
Docs • Svelte
In development mode (see the compiler options), a warning will be printed if ... Comments beginning with svelte-ignore disable warnings for the next...
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