aboutsummaryrefslogtreecommitdiff
path: root/pass-otp.bash.completion
diff options
context:
space:
mode:
authorZoltan Kertesz <zoli@eternity.hu>2018-10-19 14:50:57 +0100
committerZoltan Kertesz <zoli@eternity.hu>2018-10-19 14:50:57 +0100
commit96ee01de6cc2b8bbd784e984a6438587890c4d28 (patch)
tree21a52a2142ebf43e764942e801b3768db085809f /pass-otp.bash.completion
parent4db4feb628fe84558283a30ea52435610dd2ca12 (diff)
downloadpass-otp-96ee01de6cc2b8bbd784e984a6438587890c4d28.tar.gz
pass-otp-96ee01de6cc2b8bbd784e984a6438587890c4d28.zip
Add bash_completion support
Diffstat (limited to 'pass-otp.bash.completion')
-rw-r--r--pass-otp.bash.completion26
1 files changed, 26 insertions, 0 deletions
diff --git a/pass-otp.bash.completion b/pass-otp.bash.completion
new file mode 100644
index 0000000..5b13dcc
--- /dev/null
+++ b/pass-otp.bash.completion
@@ -0,0 +1,26 @@
+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" -- ${cur}))
+ _pass_complete_entries 1
+ fi
+}