Comments (3)
Interesting! 1.7.0 had a major shift in Rich-Click's internals, and I guess a few things fell under the cracks.
I'm not on Windows, but I think I see what the issue is: In 1.7.0, the config variable legacy_windows
was added and its default is False
, whereas its default should probably be None
.
Can you confirm that the issue is fixed if you run the help text for the following?
import rich_click as click
@click.command()
@click.option("--count", default=1, help="Number of greetings.")
@click.option("--name", prompt="Your name", help="The person to greet.")
@click.rich_config(help_config=click.RichHelpConfiguration(legacy_windows=None))
def hello(count, name):
"""Simple program that greets NAME for a total of COUNT times."""
for _ in range(count):
click.echo(f"Hello, {name}!")
if __name__ == '__main__':
hello()
Note the addition of @click.rich_config(help_config=click.RichHelpConfiguration(legacy_windows=None))
. I do agree that, since Rich auto-detects this for users, this implies None
should be the default.
from rich-click.
yes! adding:
@click.rich_config(help_config=click.RichHelpConfiguration(legacy_windows=None))
to all the commands in 01_simple.py fixed it.
Well done!
from rich-click.
@djkawa legacy_windows
is now by default set to None
in the latest release of rich-click, 1.7.4
. So you don't need to use the @rich_config()
decorator anymore. Thanks for opening this issue!
from rich-click.
Related Issues (20)
- Expose a way to send usage information to stderr HOT 9
- support providing a default/global `option_groups` config to apply to all commands HOT 7
- Unit tests should assert output to stderr on errors
- Either update or deprecate MacPorts install HOT 5
- `text_markup: Literal["rich", "markdown", "rst", None]` config option HOT 1
- Additional style options HOT 1
- `rich-click` CLI for version `1.8.0dev1` breaks backwards compatibility in edge case
- 1.9 wishlist
- 2.0 roadmap
- 'RichGroup' object has no attribute 'isolation' HOT 2
- Bugs (a) generating svg/html with decorator. (b) with root directory scripts HOT 1
- Interim blog post - "5 cool pre-made styles for your CLI" (title tentative)
- Color part of the help massage HOT 8
- OptionHighlighter is deprecated and will be removed in a future version. HOT 6
- Invalid MRO when importing rich_click HOT 4
- Continuting to receive "DeprecationWarning: OptionHighlighter is deprecated" as of 1.8.1 HOT 3
- Fix warning (again)
- Show commands before options HOT 5
- Grouped `--help` output is not shown for `__main__.py` CLIs (`python -m foo`) / add support for `prog_name` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rich-click.