17dd5792b4a34e65311fda6ab469b98f31cf30df

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Update pass completion to upstream

Conflicts:
	plugins/pass/_pass

Diff

 1diff --git a/plugins/pass/_pass b/plugins/pass/_pass
 2index f03aa01692c0729bb035b46e57c0d1a00c2f96ba..9c4b669bdbefc123b32901350cb5ef793674d281 100644
 3--- a/plugins/pass/_pass
 4+++ b/plugins/pass/_pass
 5@@ -1,10 +1,10 @@
 6 #compdef pass
 7 #autoload
 8 
 9-# Copyright (C) 2012:
10+# Copyright (C) 2012 - 2014:
11 #    Johan Venant <jvenant@invicem.pro>
12 #    Brian Mattern <rephorm@rephorm.com>
13-#    Jason A. Donenfeld <Jason@zx2c4.com>
14+#    Jason A. Donenfeld <Jason@zx2c4.com>.
15 # All Rights Reserved.
16 #
17 # This file is licensed under the GPLv2+.
18@@ -26,8 +26,8 @@ _pass () {
19 		case "${cmd}" in
20 			init)
21 				_arguments : \
22-					"-r[re-encrypt existing passwords]" \
23-					"--reencrypt[re-encrypt existing passwords]"
24+					"-p[gpg-id will only be applied to this subfolder]" \
25+					"--path[gpg-id will only be applied to this subfolder]"
26 				_pass_complete_keys
27 				;;
28 			ls|list|edit)
29@@ -46,9 +46,19 @@ _pass () {
30 					"-n[don't include symbols in password]" \
31 					"--no-symbols[don't include symbols in password]" \
32 					"-c[copy password to the clipboard]" \
33-					"--clip[copy password to the clipboard]"
34+					"--clip[copy password to the clipboard]" \
35+					"-f[force overwrite]" \
36+					"--force[force overwrite]" \
37+					"-i[replace first line]" \
38+					"--in-place[replace first line]"
39 				_pass_complete_entries_with_subdirs
40 				;;
41+			cp|copy|mv|rename)
42+				_arguments : \
43+					"-f[force rename]" \
44+					"--force[force rename]"
45+					_pass_complete_entries_with_subdirs
46+				;;
47 			rm)
48 				_arguments : \
49 					"-f[force deletion]" \
50@@ -78,10 +88,14 @@ _pass () {
51 		subcommands=(
52 			"init:Initialize new password storage"
53 			"ls:List passwords"
54+			"find:Find password files or directories based on pattern"
55+			"grep:Search inside decrypted password files for matching pattern"
56 			"show:Decrypt and print a password"
57 			"insert:Insert a new password"
58 			"generate:Generate a new password using pwgen"
59 			"edit:Edit a password with \$EDITOR"
60+			"mv:Rename the password"
61+			"cp:Copy the password"
62 			"rm:Remove the password"
63 			"git:Call git on the password store"
64 			"version:Output version information"
65@@ -104,7 +118,7 @@ _pass_cmd_show () {
66 _pass_complete_entries_helper () {
67 	local IFS=$'\n'
68 	local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
69-	_values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort)
70+	_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)
71 }
72 
73 _pass_complete_entries_with_subdirs () {