1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-10-12 19:09:10 +00:00
trezor-firmware/bash_completion.d/trezorctl.sh
2016-06-22 17:26:11 +02:00

15 lines
329 B
Bash

_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