You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new `dist.completion-cmds` option which takes a map of binary
names to the subcommand to execute to generate shell completions.
This hooks in very easily with the Homebrew
`generate_completions_from_executable` helper function. We allow three
options for completion generation, `clap-env`, which will use
`clap_complete`'s environment variable option to trigger shell
completion, or `subcommand`, which specifies the subcommand and
parameter format, flag or arg, for the command. All options take an
array of shells.
```toml
[dist.completion-cmds.mybin]
trigger = "clap-env"
shells = ["bash","fish"]
[dist.completion-cmds.otherbin]
trigger.subcommand = {{ name = "completions", format = "flag" }}
shells = ["bash","fish","pwsh","zsh"]
```
Copy file name to clipboardExpand all lines: CHANGELOG.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,19 @@ Nothing Yet!
5
5
# Version 1.0.6 (2025-07-03)
6
6
7
7
- Change committer of Homebrew formulas to the owner of GITHUB_TOKEN.
8
+
- Add `dist.completion-cmds` option. This takes a map of binaries and a corresponding subcommand which can be executed to generate shell completions. Completions for `bash`, `zsh`, and `fish` will be installed. Currently this only used for Homebrew installs.
9
+
10
+
Example configs:
11
+
12
+
```toml
13
+
[dist.completion-cmds.mybin]
14
+
trigger = "clap-env"
15
+
shells = ["bash","fish"]
16
+
17
+
[dist.completion-cmds.otherbin]
18
+
trigger.subcommand = {{ name = "completions", format = "flag" }}
0 commit comments