summaryrefslogtreecommitdiff
path: root/bash-completion
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2012-09-08 01:51:29 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2012-09-08 01:51:29 +0200
commita6129c9e45451e8c4082eee897ff1a94c1fe1bbd (patch)
tree8d481043e6cb7d3e873b3ac9e6290ac7c9ca24da /bash-completion
parenta1788f20d294f542607d9b374e6aa71515f21663 (diff)
downloadpass-a6129c9e45451e8c4082eee897ff1a94c1fe1bbd.tar.gz
pass-a6129c9e45451e8c4082eee897ff1a94c1fe1bbd.tar.bz2
pass-a6129c9e45451e8c4082eee897ff1a94c1fe1bbd.zip
Import ZSH completion file from Johan Venant <jvenant@invicem.pro>.
Diffstat (limited to '')
-rw-r--r--bash-completion/pass-bash-completion (renamed from bash-completion/pass-bash-completion.sh)0
-rw-r--r--bash-completion/pass-zsh-completion72
2 files changed, 72 insertions, 0 deletions
diff --git a/bash-completion/pass-bash-completion.sh b/bash-completion/pass-bash-completion
index 8ddc377..8ddc377 100644
--- a/bash-completion/pass-bash-completion.sh
+++ b/bash-completion/pass-bash-completion
diff --git a/bash-completion/pass-zsh-completion b/bash-completion/pass-zsh-completion
new file mode 100644
index 0000000..bc23356
--- /dev/null
+++ b/bash-completion/pass-zsh-completion
@@ -0,0 +1,72 @@
+#compdef pass
+
+# This file is under the GPLv2+ license.
+# Heavily based on http://zsh.sf.net/Guide/zshguide06.html#l177
+# And Frédéric Perrin article http://tar-jx.bz/notes/zsh-completion.html
+# Johan Venant, September 2012
+
+
+_pass () {
+ local cmd
+ if (( CURRENT > 2)); then
+ cmd=${words[2]}
+ # Set the context for the subcommand.
+ curcontext="${curcontext%:*:*}:pass-$cmd"
+ # Narrow the range of words we are looking at to exclude `pass'
+ (( CURRENT-- ))
+ shift words
+ # Run the completion for the subcommand
+ (( $+functions[_pass_cmd_$cmd] )) && _pass_cmd_$cmd
+
+ else
+ _values : \
+ "init[Initialize new password storage]" \
+ "ls[subfolder List names of passwords]" \
+ "show[Decrypt and print a password]" \
+ "insert[Insert a new password]" \
+ "generate[Generate a new password using pwgen]" \
+ "rm[Remove the password]" \
+ "push[push the latest changes using git-push(1)]" \
+ "pull[pull the latest changes using git-pull(1)]" \
+ "git[Call git]" \
+ "help[Help]"
+ fi
+}
+
+_pass_cmd_init () {
+}
+
+_pass_cmd_ls () {
+ _arguments : \
+ '::ls:_get_stored_pwd'
+}
+
+_pass_cmd_show () {
+ _arguments : \
+ "-c[put it on the clipboard]" \
+ '*::show:_get_stored_pwd'
+ #'::pass id:_files -W ~/.password-store -g "*.gpg(|.*)(-.)"'
+}
+
+_pass_cmd_insert () {
+ _arguments : \
+ "-n[no console output]" \
+ "-m[multiline]" \
+ '::show:_get_stored_pwd'
+}
+
+_pass_cmd_generate () {
+ _arguments : \
+ "-n[no symbols]" \
+ "-c[put password on the clipboard]" \
+ '::show:_get_stored_pwd'
+}
+
+_pass_cmd_rm () {
+ _arguments : \
+ '::ls:_get_stored_pwd'
+}
+
+_get_stored_pwd () {
+ compadd `find ~/.password-store \( -name .git -o -name .gpg-id \) -prune -o -print | sed 's#.*/.password-store/\?##' | sed 's#\.gpg##' | sort`
+}
w=1'>Upload mails to imapRené 'Necoro' Neumann3-35/+80 2020-04-21Move HTML template to stringRené 'Necoro' Neumann3-12/+13 2020-04-21HTML Template part of the mailRené 'Necoro' Neumann7-18/+199 2020-04-20Fixes and validationRené 'Necoro' Neumann6-28/+25 2020-04-20Fix vettingRené 'Necoro' Neumann1-1/+1 2020-04-20Started with mail creationRené 'Necoro' Neumann4-3/+126 2020-04-20FeeditemsRené 'Necoro' Neumann2-2/+14 2020-04-20GlobalOptionsRené 'Necoro' Neumann3-25/+79 2020-04-19RestructureRené 'Necoro' Neumann6-152/+177 2020-04-19Rename package 'parse' to 'feed'René 'Necoro' Neumann2-3/+3 2020-04-19SELECT is not necessary for most operations -- skip itRené 'Necoro' Neumann2-12/+1 2020-04-19Store path as array -- the delimiter is not always '.'René 'Necoro' Neumann3-36/+44 2020-04-19Split client part to client.goRené 'Necoro' Neumann2-125/+137 2020-04-19IMAP: Create foldersRené 'Necoro' Neumann1-4/+38 2020-04-19Improved IMAPRené 'Necoro' Neumann1-3/+88 2020-04-19Started IMAP connectionRené 'Necoro' Neumann4-0/+152 2020-04-19Use our own logger for debug for convenience sakeRené 'Necoro' Neumann1-2/+3 2020-04-19Fix debug logging m(René 'Necoro' Neumann1-2/+2 2020-04-19Rename util.go to log.go. Add verbose modeRené 'Necoro' Neumann4-24/+54 2020-04-19Clean go.modRené 'Necoro' Neumann2-3/+0 2020-04-19Do not print the parsedCfg anymoreRené 'Necoro' Neumann1-1/+1 2020-04-19Increase go-version to 1.14René 'Necoro' Neumann1-2/+2 2020-04-19CI: go vetRené 'Necoro' Neumann1-0/+3 2020-04-19Fetching and parsing the feedsRené 'Necoro' Neumann5-4/+113 2020-04-19Ignore all config*.ymlRené 'Necoro' Neumann1-1/+1