github jdx/usage v7.1.3
v7.1.3: Order subcommand help sections by display_order

4 hours ago

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_heading can now put the default Commands: section after their named sections (#1583, @jdx). Each section is placed according to the lowest display_order among its commands. A command without a display_order counts as 999, so the built-in help never moves its section forward. Sections with the same value keep their current order. usage-argv runtime help and the usage-lib reference 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), then Source:, then Dependencies:. It now lists Source:, Dependencies:, then Commands:.

    If none of your commands set display_order, help looks the same as before. If you set display_order on 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.

Don't miss a new usage release

NewReleases is sending notifications on new releases.