Two completion fixes: completing a script now uses the same .<script>.usage.kdl sidecar spec that usage exec runs with, and short flags show their help text in completion menus.
Fixed
- (complete)
usage complete-word -f <script>now reads a.<script>.usage.kdlfile next to the script before falling back to itsUSAGEcomments, the same lookupusage execalready did (#1558, @jdx). Before this, a script with a sidecar completed against the comment spec, or against nothing at all. The bash, zsh and fish scripts fromusage generate completion-initcallcomplete-word, so they get the fix without being regenerated. Otherusage generatesubcommands that take-f <script>, such ascompletionandmarkdown, now prefer the sidecar too. When the sidecar doesn't setnameorbin, the script's basename is used. Inline specs and stdin input work as before. - (complete) Short flags now show their help text in completion menus, as long flags already did (#1561, @Ehsan-hash). For
flag "-v --verbose" help="Verbose output", completing-vused to show no description and now showsVerbose output. If a root command and a subcommand both define the same short flag, the menu shows the help for the flag that actually applies. Bash completions still list flag names only, with no descriptions.
New Contributors
- @Ehsan-hash made their first contribution in #1561
Full Changelog: v7.0.1...v7.0.2
💚 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.