mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 08:53:21 +00:00
Merge pull request #248916 from nagy/jc-completion
jc: add shell completions
This commit is contained in:
commit
0bbfea460a
@ -1,6 +1,9 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, buildPackages
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, installShellFiles
|
||||
, ruamel-yaml
|
||||
, xmltodict
|
||||
, pygments
|
||||
@ -22,6 +25,14 @@ buildPythonPackage rec {
|
||||
|
||||
propagatedBuildInputs = [ ruamel-yaml xmltodict pygments ];
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
postInstall = let emulator = stdenv.hostPlatform.emulator buildPackages; in ''
|
||||
installShellCompletion --cmd jc \
|
||||
--bash <(${emulator} $out/bin/jc --bash-comp) \
|
||||
--zsh <(${emulator} $out/bin/jc --zsh-comp)
|
||||
'';
|
||||
|
||||
nativeCheckInputs = [ pytestCheckHook ];
|
||||
|
||||
pythonImportsCheck = [ "jc" ];
|
||||
|
Loading…
Reference in New Issue
Block a user