Files
pass-otp-mirror/pass-otp.bash.completion
Martin Kletzander 99419824e1 Add support for quiet output of otp code command
When using this option the output of `pass otp -q ...` is predictable and can be
further used without parsing even when the password store is a repository as
well.  This is useful, for example, when using rofi-pass.

The patch is written in a way that other commands can optionally use the quiet
option for otp_insert as well.
2020-09-12 12:49:24 -07:00

27 lines
765 B
Plaintext

PASSWORD_STORE_EXTENSION_COMMANDS+=(otp)
__password_store_extension_complete_otp() {
if [[ $COMP_CWORD -gt 2 ]]; then
case "${COMP_WORDS[2]}" in
insert|append)
COMPREPLY+=($(compgen -W "-e --echo -f --force -s --secret -i --issuer -a --account" -- ${cur}))
_pass_complete_entries
;;
uri)
COMPREPLY+=($(compgen -W "-c --clip -q --qrcode" -- ${cur}))
_pass_complete_entries
;;
validate)
_pass_complete_entries
;;
*)
COMPREPLY+=($(compgen -W "-h --help" -- ${cur}))
_pass_complete_entries
;;
esac
else
COMPREPLY+=($(compgen -W "insert append uri validate -h --help -c --clip -q --quiet" -- ${cur}))
_pass_complete_entries 1
fi
}