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

Short option for log level should be shown without equals sign in help output #21431

Open
bdabelow opened this issue Sep 19, 2024 · 2 comments
Open

Comments

@bdabelow
Copy link

bdabelow commented Sep 19, 2024

Describe the bug
Currently pants help global shows the usage of the -l short options with an equals sign:
image

According to this comment in #21426, short options are supposed to be used without equals sign: -ldebug instead of -l=debug. This should be reflected in the help output.

I could not find any other short option beside -l, but possibly others might also be affected.

Pants version
2.24.0.dev0

OS
Linux

@bdabelow bdabelow added the bug label Sep 19, 2024
@bdabelow bdabelow changed the title Short option for log level should be shown withoput equals sign in help output Short option for log level should be shown without equals sign in help output Sep 19, 2024
@huonw
Copy link
Contributor

huonw commented Sep 20, 2024

Thanks for flagging!

It looks like this logic is controlled by the code below. Some parts of that have logic checking is_short_arg, but this one doesn't and should.

metavar = self.compute_metavar(kwargs)
display_args.append(f"{scoped_arg}={metavar}")

Are you interested and able in sending a patch that slots in something like separator = "" if is_short_arg else "=" to that part of the code?

@huonw
Copy link
Contributor

huonw commented Sep 20, 2024

(I note that this affects the online docs too: https://www.pantsbuild.org/2.22/reference/global-options#level . I believe the fix to that code should fix those too, as the CLI and HTML docs are generated from the same code.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants