We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would it be possible to apply the Rich formatting without monkey patching?
I was thinking that the rich_click namespace could replicate the click namespace. But supply customized version of Click objects (via inheritance).
rich_click
click
This is what we have currently:
import click import rich_click class RichClickGroup(click.Group): def format_help(self, ctx, formatter): rich_click.rich_format_help(self, ctx, formatter) class RichClickCommand(click.Command): def format_help(self, ctx, formatter): rich_click.rich_format_help(self, ctx, formatter) @click.group(cls=RichClickGroup) @click.option('--debug/--no-debug', default=False) def cli(debug): click.echo(f"Debug mode is {'on' if debug else 'off'}") @cli.command(cls=RichClickCommand) def sync(): click.echo('Syncing')
But I think it could be as simple (for the user at least) as this:
import rich_click as click @click.group() @click.option('--debug/--no-debug', default=False) def cli(debug): click.echo(f"Debug mode is {'on' if debug else 'off'}") @cli.command() def sync(): click.echo('Syncing')
Thoughts?
Originally posted by @willmcgugan in #7
The text was updated successfully, but these errors were encountered:
Done in #10
Sorry, something went wrong.
No branches or pull requests
Would it be possible to apply the Rich formatting without monkey patching?
I was thinking that the
rich_click
namespace could replicate theclick
namespace. But supply customized version of Click objects (via inheritance).This is what we have currently:
But I think it could be as simple (for the user at least) as this:
Thoughts?
Originally posted by @willmcgugan in #7
The text was updated successfully, but these errors were encountered: