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.

Rich-click does not format nested commands

See original GitHub issue

Nested commands are not formatted at all. Because I couldnโ€™t get my script to work correctly I tried the simple example script. I get:

$ python rich_click_ex1.py

 Usage: rich_click_ex1.py [OPTIONS] COMMAND [ARGS]...

 My amazing tool does all the things.
 This is a minimal example based on documentation from the 'click' package.
 You can try using --help at the top level and also for specific group
 subcommands.

โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ --debug/--no-debug  -d/-n    Enable debug mode. Newlines are removed by      โ”‚
โ”‚                              default.                                        โ”‚
โ”‚                              Double newlines are preserved.                  โ”‚
โ”‚ --help                       Show this message and exit.                     โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Commands โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ download  Optionally use short-help for the group help text                  โ”‚
โ”‚ sync      Synchronise all your files between two places. Example command     โ”‚
โ”‚           that doesn't do much except print to the terminal.                 โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

This works as advertised. However:

$ python rich_click_ex1.py sync --help
Debug mode is off
Usage: rich_click_ex1.py sync [OPTIONS]

  Synchronise all your files between two places. Example command that
  doesn't do much except print to the terminal.

Options:
  --type TEXT  Type of file to sync  [default: files; required]
  --all
  --help       Show this message and exit.

This does not work as advertised. Am I missing something? Should the example script be updated or is this a bug?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
davidfokkemacommented, Sep 12, 2022

Iโ€™ll add a note to the readme though ๐Ÿ™‚

Great, thanks! That will save the next person some time, ๐Ÿ˜€.

1reaction
davidfokkemacommented, Sep 11, 2022

Love your project, by the way!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ewels/rich-click: Format click help output nicely with rich.
Here we create two groups of commands for the base command of mytool . Any subcommands not listed will automatically be printed in...
Read more >
rich-click - PyPI
Click is a "Python package for creating beautiful command line interfaces". Rich is a "Python library for rich text and beautiful formatting in...
Read more >
Formatting text with Markdown - Zendesk help
If you paste text with Markdown commands from a rich text editor, the Markdown commands remain "as is". The content is not automaticallyย ......
Read more >
Add commands to the Quick Access Toolbar - Microsoft Support
For commands that you can't right-click ยท Click Customize the Quick Access Toolbar, and then click More Commands. Add a custom command the...
Read more >
Can I add multiple clipboards to the right click copy command?
I was hoping to have multiple copy options in the right click menu. Like: Copy(1) Copy(2) Copy(3). Paste(1) Paste(2) Paste(3).
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