github jdx/usage v7.4.1
v7.4.1: Fix PowerShell subcommand completion, fish backslash escaping, and Cobra choices

one hour ago

Three bug fixes: PowerShell completion after a space, fish completion scripts that embed a spec, and Cobra-generated choices blocks. These fixes are in the generated scripts and specs, so regenerate any you have already written out to pick them up.

Fixed

  • (powershell) Pressing Tab after a space (for example mise <Tab> or mise use <Tab>) now offers subcommands and arguments instead of file names (#1672, @jdx). The completer had been dropping the trailing space before passing the line to the binary. The fix is in the Rust generator, the Go argv generator and the checked-in usage.ps1. Thanks to @kangmingxuan for reporting and diagnosing it.
  • (fish) Completion scripts made with usage generate completion fish --file spec.kdl now keep backslashes in the embedded spec (#1659, @jdx). Before, fish's single-quote unescaping took away one level of backslashes. A complete ... run= command with escapes such as jq's \(.name), \t or a regex escape then turned into invalid KDL. When that happened, every completion for the binary silently returned nothing.
  • (cobra) Specs generated from Cobra commands with ValidArgs now pass usage lint, for both root commands and subcommands (#1670, @jdx). The generator now writes choice "dev" inside choices blocks instead of a bare "dev". Choices on flag arguments use the same format.

Full Changelog: v7.4.0...v7.4.1

💚 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.