mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-03 02:33:15 +00:00
Merge pull request #300562 from maxbrunet/feat/tanka/fish-zsh-shell-completions
This commit is contained in:
commit
2fac417e7a
@ -23,7 +23,30 @@ buildGoModule rec {
|
||||
|
||||
postInstall = ''
|
||||
echo "complete -C $out/bin/tk tk" > tk.bash
|
||||
installShellCompletion tk.bash
|
||||
|
||||
cat >tk.fish <<EOF
|
||||
|
||||
function __complete_tk
|
||||
set -lx COMP_LINE (commandline -cp)
|
||||
test -z (commandline -ct)
|
||||
and set COMP_LINE "\$COMP_LINE "
|
||||
$out/bin/tk
|
||||
end
|
||||
complete -f -c tk -a "(__complete_tk)"
|
||||
|
||||
EOF
|
||||
|
||||
cat >tk.zsh <<EOF
|
||||
#compdef tk
|
||||
autoload -U +X bashcompinit && bashcompinit
|
||||
complete -o nospace -C $out/bin/tk tk
|
||||
EOF
|
||||
|
||||
installShellCompletion \
|
||||
--cmd tk \
|
||||
--bash tk.bash \
|
||||
--fish tk.fish \
|
||||
--zsh tk.zsh
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
Loading…
Reference in New Issue
Block a user