trash-cli: use installShellCompletion
This commit is contained in:
parent
8634641676
commit
f7cb50b3cf
|
@ -1,4 +1,4 @@
|
||||||
{ lib, fetchFromGitHub, python3Packages }:
|
{ lib, fetchFromGitHub, installShellFiles, python3Packages }:
|
||||||
|
|
||||||
python3Packages.buildPythonApplication rec {
|
python3Packages.buildPythonApplication rec {
|
||||||
pname = "trash-cli";
|
pname = "trash-cli";
|
||||||
|
@ -13,6 +13,11 @@ python3Packages.buildPythonApplication rec {
|
||||||
|
|
||||||
propagatedBuildInputs = with python3Packages; [ psutil six ];
|
propagatedBuildInputs = with python3Packages; [ psutil six ];
|
||||||
|
|
||||||
|
nativeBuildInputs = with python3Packages; [
|
||||||
|
installShellFiles
|
||||||
|
shtab
|
||||||
|
];
|
||||||
|
|
||||||
nativeCheckInputs = with python3Packages; [
|
nativeCheckInputs = with python3Packages; [
|
||||||
mock
|
mock
|
||||||
pytestCheckHook
|
pytestCheckHook
|
||||||
|
@ -44,13 +49,10 @@ python3Packages.buildPythonApplication rec {
|
||||||
runHook postInstallCheck
|
runHook postInstallCheck
|
||||||
'';
|
'';
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
for bin in trash{,-{empty,list,put,restore}}; do
|
for bin in trash-empty trash-list trash-restore trash-put trash; do
|
||||||
$out/bin/$bin --print-completion bash > $bin
|
installShellCompletion --cmd "$bin" \
|
||||||
install -Dm644 $bin -t $out/share/bash-completion/completions
|
--bash <("$out/bin/$bin" --print-completion bash) \
|
||||||
$out/bin/$bin --print-completion zsh > _$bin
|
--zsh <("$out/bin/$bin" --print-completion zsh)
|
||||||
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
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue