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>ormise 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 Goargvgenerator and the checked-inusage.ps1. Thanks to @kangmingxuan for reporting and diagnosing it. - (fish) Completion scripts made with
usage generate completion fish --file spec.kdlnow keep backslashes in the embedded spec (#1659, @jdx). Before, fish's single-quote unescaping took away one level of backslashes. Acomplete ... run=command with escapes such as jq's\(.name),\tor 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
ValidArgsnow passusage lint, for both root commands and subcommands (#1670, @jdx). The generator now writeschoice "dev"insidechoicesblocks 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.