Sort the options in --help alphabetically - #1044
Conversation
The options were listed in declaration order, which is essentially arbitrary. Ask clap to sort them alphabetically instead. Closes Wilfred#830 Written with AI assistance (Claude Code); I have read the change and am accountable for it.
|
How does the order look now? Do you think it needs more grouping? |
|
Here is the full list as it stands:
Two things you may or may not like:
On grouping: I would say no for now. There are only twenty options in the main list, which is short enough to scan, and the natural clusters are small and would not divide cleanly. If you do want headings, the split I would trust is a small OUTPUT group ( |
|
Are you writing PR comments with AI? |
|
Yes, and I owe you a straight answer plus an apology for making you ask. I use Claude Code. It writes the code and the prose, and I review and test before sending. Your AI_POLICY.md asks for disclosure in the PR description, and I did that on #1041 and #1042 but not on #1043 or this one. That was sloppy on my part, not a deliberate omission: when I split this out of #1041 at your request I rewrote the description and dropped the line. I have just added it back here. On the substance of this PR, so you can judge it rather than the process: it is I understand if the answer changes how you want to handle these three PRs. If you would rather not take AI-assisted contributions in practice, whatever the policy allows on paper, say so and I will close them and stop, no argument. Your project, your call, and I would rather hear that than have you spend review time on things you did not want. |
Split out of #1041, as you asked.
What's broken
difft --helplists options in declaration order, so related flags are scattered and there is no way to scan for one by name.The fix
next_display_order(None)tells clap to sort them alphabetically. One line, no behaviour change beyond the help output.Verification
cargo buildanddifft --helpshow the options sorted.cargo testpasses.Disclosure per AI_POLICY.md: written with AI assistance (Claude Code). I have read every line and am accountable for it; happy to discuss any part.