From cc908fb90cc5ea8410e67bbf073f208daafa1b67 Mon Sep 17 00:00:00 2001 From: Vladyslav Burzakovskyy Date: Thu, 25 Oct 2018 02:25:25 +0200 Subject: [PATCH] cache autocompletion --- bash_completion.d/trezorctl.sh | 9 ++++++++- vendor/trezor-common | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bash_completion.d/trezorctl.sh b/bash_completion.d/trezorctl.sh index 684035897d..581c15829e 100644 --- a/bash_completion.d/trezorctl.sh +++ b/bash_completion.d/trezorctl.sh @@ -1,11 +1,18 @@ _trezorctl() { + export TREZORCTL_COMPLETION_CACHE local cur prev cmds base + COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" - cmds=$(trezorctl --help | grep '^ [a-z]' | awk '{ print $1 }') + if [ -z "$TREZORCTL_COMPLETION_CACHE" ]; then + help_output=$(trezorctl --help | grep '^ [a-z]' | awk '{ print $1 }') + export TREZORCTL_COMPLETION_CACHE="$help_output" + fi + + cmds="$TREZORCTL_COMPLETION_CACHE" COMPREPLY=($(compgen -W "${cmds}" -- ${cur})) return 0 diff --git a/vendor/trezor-common b/vendor/trezor-common index dacbc7260c..11221cfe1c 160000 --- a/vendor/trezor-common +++ b/vendor/trezor-common @@ -1 +1 @@ -Subproject commit dacbc7260cc6c2c77001186d50a59ccbfb73dbb0 +Subproject commit 11221cfe1cc5bda4d7b999517e92dd87ad00f2bc