mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
Merge pull request #316774 from NixOS/backport-300562-to-release-24.05
This commit is contained in:
commit
4918b760e5
@ -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