Issue
Using the Zsh completions of the coreutils binary created by running cargo run completion coreutils zsh results in an error:
coreutils _coreutils:1418: invalid subscript
_coreutils:1419: bad pattern: _coreutils__[_commands
_coreutils:23: bad pattern: [
_coreutils:23: bad pattern: [
Description
Creating completions using cargo run completion coreutils zsh will create completions for the uu_test create and thus both test and [ binaries as given here:
|
"uu_test" => { |
|
phf_map.entry("test", &map_value); |
|
phf_map.entry("[", &map_value); |
|
} |
This results in a completions file containing the following:
- lines 689-694
([)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
- lines 1177-1180
([)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
- lines 1418-1427
(( $+functions[_coreutils__[_commands] )) ||
_coreutils__[_commands() {
local commands; commands=()
_describe -t commands 'coreutils [ commands' commands "$@"
}
(( $+functions[_coreutils__help__[_commands] )) ||
_coreutils__help__[_commands() {
local commands; commands=()
_describe -t commands 'coreutils help [ commands' commands "$@"
}
Each of the snippets above contain invalid opening square brackets, resulting in the shown errors when using the generated completions in Zsh.
Workaround
Removing line 62 in build.rs fixes the issue:
|
phf_map.entry("[", &map_value); |
Background
I installed the multicall binary from source and created the completions as given above, placing them in $FPATH. I am using Zsh 5.9.4 (with Oh My Zsh) on an Arch-based distro.
Issue
Using the Zsh completions of the
coreutilsbinary created by runningcargo run completion coreutils zshresults in an error:Description
Creating completions using
cargo run completion coreutils zshwill create completions for theuu_testcreate and thus bothtestand[binaries as given here:coreutils/build.rs
Lines 60 to 63 in 97d30bd
This results in a completions file containing the following:
Each of the snippets above contain invalid opening square brackets, resulting in the shown errors when using the generated completions in Zsh.
Workaround
Removing line 62 in build.rs fixes the issue:
coreutils/build.rs
Line 62 in 97d30bd
Background
I installed the multicall binary from source and created the completions as given above, placing them in
$FPATH. I am using Zsh 5.9.4 (with Oh My Zsh) on an Arch-based distro.