Merge pull request #316774 from NixOS/backport-300562-to-release-24.05

This commit is contained in:
Sandro 2024-06-05 12:17:15 +02:00 committed by GitHub
commit 4918b760e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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; {