display_order on a subcommand now sets where its whole help section appears, not just its position within the section. Before this, the ungrouped Commands: section, which holds the built-in help, always came first.
Fixed
-
(cli) CLIs that group subcommands with
help_headingcan now put the defaultCommands:section after their named sections (#1583, @jdx). Each section is placed according to the lowestdisplay_orderamong its commands. A command without adisplay_ordercounts as999, so the built-inhelpnever moves its section forward. Sections with the same value keep their current order.usage-argvruntime help and theusage-libreference renderer both follow this rule.enum Cmds { #[usage(display_order = 99)] Completion(NoArgs), #[usage(help_heading = "Source", display_order = 1)] Fmt(NoArgs), #[usage(help_heading = "Dependencies", display_order = 2)] Fetch(NoArgs), }
Help used to list
Commands:(completion, help), thenSource:, thenDependencies:. It now listsSource:,Dependencies:, thenCommands:.If none of your commands set
display_order, help looks the same as before. If you setdisplay_orderon grouped commands but not on ungrouped ones, the ungrouped section now appears last.
Full Changelog: v7.1.2...v7.1.3
💚 Sponsor usage
usage is built and maintained by @jdx, an open source developer at entire.io, the title sponsor of his open source work.
If usage powers CLI specs, docs, or completions for a tool you maintain or use, please consider becoming an individual or company sponsor. Your support funds ongoing development and helps keep usage fast, free, and independent.