Coder Social home page Coder Social logo

Comments (3)

dwreeves avatar dwreeves commented on June 10, 2024

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.

djkawa avatar djkawa commented on June 10, 2024

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.

dwreeves avatar dwreeves commented on June 10, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.