about summary refs log tree commit diff
path: root/pkgs/applications/misc
diff options
context:
space:
mode:
authorFabián Heredia Montiel <303897+fabianhjr@users.noreply.github.com>2023-10-19 21:50:03 -0600
committerGitHub <noreply@github.com>2023-10-19 21:50:03 -0600
commitc3bb709fdb38d53d012bc4e20a124c1bd0507065 (patch)
tree01a6d613bf1dd643a936f74aa0114b353e982ada /pkgs/applications/misc
parentd06515a02065c7d2874abd54b3f18754f6a74b53 (diff)
parentf277c9494ef2c48ef33b2b2f354fb60a24b29787 (diff)
Merge pull request #262166 from wkral/leetcode-completions
leetcode-cli: Add shell completions
Diffstat (limited to 'pkgs/applications/misc')
-rw-r--r--pkgs/applications/misc/leetcode-cli/default.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/applications/misc/leetcode-cli/default.nix b/pkgs/applications/misc/leetcode-cli/default.nix
index be9102b6120b3..4ea55b39c5315 100644
--- a/pkgs/applications/misc/leetcode-cli/default.nix
+++ b/pkgs/applications/misc/leetcode-cli/default.nix
@@ -2,6 +2,7 @@
 , fetchCrate
 , rustPlatform
 , pkg-config
+, installShellFiles
 , openssl
 , dbus
 , sqlite
@@ -24,6 +25,7 @@ rustPlatform.buildRustPackage rec {
 
   nativeBuildInputs = [
     pkg-config
+    installShellFiles
   ];
 
   buildInputs = [
@@ -32,6 +34,13 @@ rustPlatform.buildRustPackage rec {
     sqlite
   ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
 
+  postInstall = ''
+    installShellCompletion --cmd leetcode \
+      --bash <($out/bin/leetcode completions bash) \
+      --fish <($out/bin/leetcode completions fish) \
+      --zsh <($out/bin/leetcode completions zsh)
+  '';
+
   passthru.tests = testers.testVersion {
     package = leetcode-cli;
     command = "leetcode -V";