Skip to content

Conversation

@jouve
Copy link
Contributor

@jouve jouve commented Oct 8, 2023

Changes

display --help actions correctly when there are few actions.

fix #2656

Documentation and testing

Please consider whether this PR needs documentation and tests. This is not required, but highly appreciated:

Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the fix @jouve, nice find.

I took the liberty of refactoring this a bit to be more readable (subjective of course!) and to fix a bug where the help indent was the length of all choices combined instead of the longest choice (which I think is the behavior you wanted. You're still set as the commit author of course. Hope that's alright with you! Thanks again!

@nejch nejch enabled auto-merge (rebase) October 10, 2023 12:12
@nejch nejch merged commit b22d662 into python-gitlab:main Oct 10, 2023
@jouve
Copy link
Contributor Author

jouve commented Oct 10, 2023

no problem, I'd rather you do that than back and forth commits/ comments in the PR :)

the length I used was to try to keep "Action to execute ..." from action: aligned with "show this help message ..." from options: which seemed to be the default HelpFormatter behavior

options:
  -h, --help  show this help message and exit
              ^
action:       ^
  {list}      Action to execute on the GitLab resource.
              ^
              ^ aligned

but I think your idea will look better.

@glensc
Copy link

glensc commented Nov 16, 2023

@nejch the find is mine:

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bogus } in usage

3 participants