From e3488d0458aa555434a10fd8b732545ef97ffc03 Mon Sep 17 00:00:00 2001 From: PRESFIL Date: Sun, 16 Mar 2025 15:55:01 +0000 Subject: [PATCH] patool: Fix shell completion Closes #334457 --- pkgs/development/python-modules/patool/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/development/python-modules/patool/default.nix b/pkgs/development/python-modules/patool/default.nix index b42c95661b57..8e868ce3ac2c 100644 --- a/pkgs/development/python-modules/patool/default.nix +++ b/pkgs/development/python-modules/patool/default.nix @@ -1,8 +1,10 @@ { + argcomplete, lib, stdenv, buildPythonPackage, fetchFromGitHub, + installShellFiles, pytestCheckHook, p7zip, cabextract, @@ -59,6 +61,17 @@ buildPythonPackage rec { --replace "path = None" 'path = os.environ["PATH"] + ":${lib.makeBinPath compression-utilities}"' ''; + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd patool \ + --bash <(${argcomplete}/bin/register-python-argcomplete -s bash $out/bin/patool) \ + --fish <(${argcomplete}/bin/register-python-argcomplete -s fish $out/bin/patool) \ + --zsh <(${argcomplete}/bin/register-python-argcomplete -s zsh $out/bin/patool) + ''; + + nativeBuildInputs = [ + installShellFiles + ]; + nativeCheckInputs = [ pytestCheckHook ] ++ compression-utilities; disabledTests = [