Merge pull request #93767 from mmilata/trezorctl-shell-completion

pythonPackages.trezor: enable shell completion
This commit is contained in:
Marek Mahut 2020-07-24 15:38:16 +02:00 committed by GitHub
commit 1d097a6c9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,7 @@
, rlp
, shamir-mnemonic
, trezor-udev-rules
, installShellFiles
}:
buildPythonPackage rec {
@ -25,6 +26,8 @@ buildPythonPackage rec {
sha256 = "0ycmpwjv5xp25993divjhaq5j766zgcy22xx39xfc1pcvldq5g7n";
};
nativeBuildInputs = [ installShellFiles ];
propagatedBuildInputs = [ typing-extensions protobuf hidapi ecdsa mnemonic requests pyblake2 click construct libusb1 rlp shamir-mnemonic trezor-udev-rules ];
checkInputs = [
@ -38,6 +41,16 @@ buildPythonPackage rec {
runHook postCheck
'';
postFixup = ''
mkdir completions
_TREZORCTL_COMPLETE=source_bash $out/bin/trezorctl > completions/trezorctl || true
_TREZORCTL_COMPLETE=source_zsh $out/bin/trezorctl > completions/_trezorctl || true
_TREZORCTL_COMPLETE=source_fish $out/bin/trezorctl > completions/trezorctl.fish || true
installShellCompletion --bash completions/trezorctl
installShellCompletion --zsh completions/_trezorctl
installShellCompletion --fish completions/trezorctl.fish
'';
meta = with lib; {
description = "Python library for communicating with TREZOR Bitcoin Hardware Wallet";
homepage = "https://github.com/trezor/trezor-firmware/tree/master/python";