From 8634641676c76bc7245ce1dd18d34b42035aea74 Mon Sep 17 00:00:00 2001 From: wzy <32936898+Freed-Wu@users.noreply.github.com> Date: Thu, 30 Mar 2023 16:34:55 +0800 Subject: [PATCH] trash-cli: add shell completions --- pkgs/tools/misc/trash-cli/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/tools/misc/trash-cli/default.nix b/pkgs/tools/misc/trash-cli/default.nix index f607da9099a0..fdc99fcfaa00 100644 --- a/pkgs/tools/misc/trash-cli/default.nix +++ b/pkgs/tools/misc/trash-cli/default.nix @@ -43,6 +43,16 @@ python3Packages.buildPythonApplication rec { runHook postInstallCheck ''; + postInstall = '' + for bin in trash{,-{empty,list,put,restore}}; do + $out/bin/$bin --print-completion bash > $bin + install -Dm644 $bin -t $out/share/bash-completion/completions + $out/bin/$bin --print-completion zsh > _$bin + install -Dm644 _$bin -t $out/share/zsh/site-functions + $out/bin/$bin --print-completion tcsh > $bin.csh + install -Dm644 $bin.csh -t $out/etc/profile.d + done + ''; meta = with lib; { homepage = "https://github.com/andreafrancia/trash-cli";