summaryrefslogtreecommitdiff
path: root/bash-completion
diff options
context:
space:
mode:
Diffstat (limited to 'bash-completion')
-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`
+}
763e2d0347c38aa8f7167f6fcfd4401fd6995dc&follow=1'>revelation2pass: add plain XML importJavali1-11/+15 I found that revelatio2pass.py script doesn't work. It can not decrypt my password file. I got following error message: raceback (most recent call last): File "git/password-store/contrib/importers/revelation2pass.py", line 159, in <module> main(args.FILE, verbose=args.verbose, xml=args.xml) File "git/password-store/contrib/importers/revelation2pass.py", line 140, in main cleardata_gz = decrypt_gz(password, data) File "git/password-store/contrib/importers/revelation2pass.py", line 117, in decrypt_gz ct = c.decrypt(cipher_text[28:]) File "/usr/lib/python2.7/site-packages/Crypto/Cipher/blockalgo.py", line 295, in decrypt return self._cipher.decrypt(ciphertext) I was unable to fix the problem, but I created a workaround, that add plain XML import option to the revelation2pass.py script. Revelation can export its password file as plain XML format. 2014-04-17platform: add cygwin supportJason A. Donenfeld2-1/+17 According to Brandon Jones, all we need to do is adjust /dev/clipboard from xclip. So we add a platform specific file to do so. http://www.relaytheurgency.com/2014/04/pass-in-cygwin-relatively-simple.html Suggested-by: Brandon Jones <jones.brandon.lee@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>