Skip to content
New issue

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

Flag option not showing correctly if short name are first #31

Closed
mrvkino opened this issue Mar 2, 2022 · 3 comments
Closed

Flag option not showing correctly if short name are first #31

mrvkino opened this issue Mar 2, 2022 · 3 comments
Labels
bug Something isn't working high priority

Comments

@mrvkino
Copy link

mrvkino commented Mar 2, 2022

Hi,

if you run the following code, the boolean flag will not display correctly. We put the short name first instead of last like in your examples.

import rich_click as click


@click.command()
@click.option(
    "-d/-n",
    "--debug/--no-debug",
    default=False,
    help="""Enable debug mode.
    Newlines are removed by default.
    Double newlines are preserved.""",
)
def main(debug) -> None:
    print(debug)


if __name__ == "__main__":
    main()

We get the following result.

image

I will try to look into it and do a PR.

@ewels ewels added bug Something isn't working high priority labels Mar 2, 2022
@ewels ewels closed this as completed in e4f0ab9 Mar 2, 2022
@ewels
Copy link
Owner

ewels commented Mar 2, 2022

Thanks for reporting this 👍🏻 Should be fixed in dev now, was just a typo that I'd missed.

@ewels
Copy link
Owner

ewels commented Mar 2, 2022

image

@ewels
Copy link
Owner

ewels commented Mar 2, 2022

Published in v1.2.1 https://pypi.org/project/rich-click/1.2.1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority
Projects
None yet
Development

No branches or pull requests

2 participants