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

fix(help)!: Make DeriveDisplayOrder the default, removing it #3975

Merged
merged 3 commits into from Jul 22, 2022

Conversation

epage
Copy link
Member

@epage epage commented Jul 22, 2022

Force sorting with next_display_order(None)

This also extends to subcommands.

Previous behavior:

  • They'd be sorted by default
  • They'd derive display order if DeriveDisplayOrder was set
    • This could be set recursively
  • The initial display order value for subcommands was 0

New behavior:

  • Sorted order is derived by default
  • Sorting is turned on by cmd.next_display_order(None)
    • This is not recursive, it must be set on each level
  • The display order incrementing is mixed with arguments
    • This does make it slightly more difficult to predict

And with that, we can remove AppSettings from the API, helping towards #3021

Fixes #2808

…rder`

Previous behavior:
- They'd be sorted by default
- They'd derive display order if `DeriveDisplayOrder` was set
  - This could be set recursively
- The initial display order value for subcommands was 0

New behavior:
- Sorted order is derived by default
- Sorting is turned on by `cmd.next_display_order(None)`
  - This is not recursive, it must be set on each level
- The display order incrementing is mixed with arguments
  - This does make it slightly more difficult to predict
Force sorting with `next_display_order(None)`

Fixes clap-rs#2808
@epage epage force-pushed the ord branch 2 times, most recently from 792c961 to 655bb4b Compare July 22, 2022 20:54
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.

Builder and clap_derive should be WYSIWYG
1 participant