From d2b8f51a07f71fabdc47ebb34360ffc4b32b1889 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 22 Jun 2016 17:26:11 +0200 Subject: [PATCH] add initial bash_completion script --- bash_completion.d/trezorctl.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 bash_completion.d/trezorctl.sh diff --git a/bash_completion.d/trezorctl.sh b/bash_completion.d/trezorctl.sh new file mode 100644 index 0000000000..ec1b30e29c --- /dev/null +++ b/bash_completion.d/trezorctl.sh @@ -0,0 +1,14 @@ +_trezorctl() +{ + local cur prev cmds base + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + + cmds=$(trezorctl --help | grep -A 1 'Available commands:' | tail -n 1 | tr '{},' ' ') + + COMPREPLY=($(compgen -W "${cmds}" -- ${cur})) + return 0 +} + +complete -F _trezorctl trezorctl