cheat: fix zsh completion

This commit is contained in:
Bojun Ren 2024-10-11 23:33:19 +08:00
parent a28d979c00
commit 228aecc365
No known key found for this signature in database
GPG Key ID: 1815BA659CF04BD2

View File

@ -16,6 +16,21 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ];
patches = [
(builtins.toFile "fix-zsh-completion.patch" ''
diff --git a/scripts/cheat.zsh b/scripts/cheat.zsh
index befe1b2..675c9f8 100755
--- a/scripts/cheat.zsh
+++ b/scripts/cheat.zsh
@@ -62,4 +62,4 @@ _cheat() {
esac
}
-compdef _cheat cheat
+_cheat "$@"
'')
];
postInstall = ''
installManPage doc/cheat.1
installShellCompletion scripts/cheat.{bash,fish,zsh}