summaryrefslogtreecommitdiff
path: root/plugins/pass
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2014-07-26 23:23:13 +0200
committerMarc Cornellà <marc.cornella@live.com>2014-08-29 00:39:33 +0200
commit17dd5792b4a34e65311fda6ab469b98f31cf30df (patch)
tree189aaf9d8f16be57becc52b623b7e599021e363d /plugins/pass
parent25a3244353076cbffc8ddb2ee592b94b17383694 (diff)
downloadzsh-17dd5792b4a34e65311fda6ab469b98f31cf30df.tar.gz
zsh-17dd5792b4a34e65311fda6ab469b98f31cf30df.tar.bz2
zsh-17dd5792b4a34e65311fda6ab469b98f31cf30df.zip
Update pass completion to upstream
Conflicts: plugins/pass/_pass
Diffstat (limited to 'plugins/pass')
-rw-r--r--plugins/pass/_pass26
1 files changed, 20 insertions, 6 deletions
diff --git a/plugins/pass/_pass b/plugins/pass/_pass
index f03aa0169..9c4b669bd 100644
--- a/plugins/pass/_pass
+++ b/plugins/pass/_pass
@@ -1,10 +1,10 @@
#compdef pass
#autoload
-# Copyright (C) 2012:
+# Copyright (C) 2012 - 2014:
# Johan Venant <jvenant@invicem.pro>
# Brian Mattern <rephorm@rephorm.com>
-# Jason A. Donenfeld <Jason@zx2c4.com>
+# Jason A. Donenfeld <Jason@zx2c4.com>.
# All Rights Reserved.
#
# This file is licensed under the GPLv2+.
@@ -26,8 +26,8 @@ _pass () {
case "${cmd}" in
init)
_arguments : \
- "-r[re-encrypt existing passwords]" \
- "--reencrypt[re-encrypt existing passwords]"
+ "-p[gpg-id will only be applied to this subfolder]" \
+ "--path[gpg-id will only be applied to this subfolder]"
_pass_complete_keys
;;
ls|list|edit)
@@ -46,9 +46,19 @@ _pass () {
"-n[don't include symbols in password]" \
"--no-symbols[don't include symbols in password]" \
"-c[copy password to the clipboard]" \
- "--clip[copy password to the clipboard]"
+ "--clip[copy password to the clipboard]" \
+ "-f[force overwrite]" \
+ "--force[force overwrite]" \
+ "-i[replace first line]" \
+ "--in-place[replace first line]"
_pass_complete_entries_with_subdirs
;;
+ cp|copy|mv|rename)
+ _arguments : \
+ "-f[force rename]" \
+ "--force[force rename]"
+ _pass_complete_entries_with_subdirs
+ ;;
rm)
_arguments : \
"-f[force deletion]" \
@@ -78,10 +88,14 @@ _pass () {
subcommands=(
"init:Initialize new password storage"
"ls:List passwords"
+ "find:Find password files or directories based on pattern"
+ "grep:Search inside decrypted password files for matching pattern"
"show:Decrypt and print a password"
"insert:Insert a new password"
"generate:Generate a new password using pwgen"
"edit:Edit a password with \$EDITOR"
+ "mv:Rename the password"
+ "cp:Copy the password"
"rm:Remove the password"
"git:Call git on the password store"
"version:Output version information"
@@ -104,7 +118,7 @@ _pass_cmd_show () {
_pass_complete_entries_helper () {
local IFS=$'\n'
local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
- _values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort)
+ _values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' | sort)
}
_pass_complete_entries_with_subdirs () {