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

How to stop flag from sorting automatically for --help? #1411

Closed
FGYFFFF opened this issue Jun 16, 2022 · 5 comments
Closed

How to stop flag from sorting automatically for --help? #1411

FGYFFFF opened this issue Jun 16, 2022 · 5 comments
Labels
area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug
Milestone

Comments

@FGYFFFF
Copy link
Contributor

FGYFFFF commented Jun 16, 2022

Previously I was using "github.com/urfave/cli" v1 and when I entered --help it displayed the flags in the order I filled them in, but when I used v2 all the flags were automatically sorted, how can I stop the automatic sorting? I didn't find any place where I can set it.

@FGYFFFF FGYFFFF added area/v2 relates to / is being considered for v2 kind/question someone asking a question status/triage maintainers still need to look into this labels Jun 16, 2022
@meatballhat meatballhat removed the status/triage maintainers still need to look into this label Jun 18, 2022
@meatballhat
Copy link
Member

@FGYFFFF This behavior was introduced recently in the v2 series via flag category support. Given that there's an expectation that the default sort order should not be by name, I'd like to explore reverting to the previous behavior. Is this something you're willing and able to contribute?

@FGYFFFF
Copy link
Contributor Author

FGYFFFF commented Jun 19, 2022 via email

@meatballhat
Copy link
Member

@FGYFFFF Great! Thank you!

@meatballhat meatballhat added kind/bug describes or fixes a bug and removed kind/question someone asking a question labels Jun 20, 2022
@meatballhat meatballhat added this to the Release 2.x milestone Jun 20, 2022
@meatballhat
Copy link
Member

Looking at this again, I think the change to automatically sorting the flags is arguably a regression because the current documentation claims that the default ordering is not sorted.:

https://cli.urfave.org/v2/#ordering

@dearchap
Copy link
Contributor

Fixed in release v2.19.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug
Projects
None yet
Development

No branches or pull requests

3 participants