forked from gopasspw/gopass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzsh.completion
296 lines (214 loc) · 10 KB
/
zsh.completion
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
#compdef gopass
_gopass () {
local cmd
if (( CURRENT > 2)); then
cmd=${words[2]}
curcontext="${curcontext%:*:*}:gopass-$cmd"
(( CURRENT-- ))
shift words
case "${cmd}" in
age)
local -a subcommands
subcommands=(
"identities:List identities"
)
_describe -t commands "gopass age" subcommands
;;
audit)
_arguments : "--expiry[Age in days before a password is considered expired. Setting this will only check expiration.]"
;;
cat)
;;
clone)
_arguments : "--path[Path to clone the repo to]" "--crypto[Select crypto backend \[age gpgcli plain\]]" "--check-keys[Check for valid decryption keys. Generate new keys if none are found.]"
;;
completion)
local -a subcommands
subcommands=(
"bash:Source for auto completion in bash"
"zsh:Source for auto completion in zsh"
"fish:Source for auto completion in fish"
)
_describe -t commands "gopass completion" subcommands
;;
config)
;;
copy|cp)
_arguments : "--force[Force to copy the secret and overwrite existing one]"
_gopass_complete_passwords
;;
create|new)
_arguments : "--store[Which store to use]" "--force[Force path selection]"
;;
delete|remove|rm)
_arguments : "--recursive[Recursive delete files and folders]" "--force[Force to delete the secret]"
_gopass_complete_passwords
;;
edit|set)
_arguments : "--editor[Use this editor binary]" "--create[Create a new secret if none found]"
_gopass_complete_passwords
;;
find|search)
;;
fsck)
_arguments : "--decrypt[Decrypt and reencryt during fsck.]"
;;
fscopy)
;;
fsmove)
;;
generate)
_arguments : "--clip[Copy the generated password to the clipboard]" "--print[Print the generated password to the terminal]" "--force[Force to overwrite existing password]" "--edit[Open secret for editing after generating a password]" "--symbols[Use symbols in the password]" "--generator[Choose a password generator, use one of: cryptic, memorable, xkcd or external. Default: cryptic]" "--strict[Require strict character class rules]" "--sep[Word separator for generated passwords. If no separator is specified, the words are combined without spaces/separator and the first character of words is capitalised.]" "--lang[Language to generate password from, currently only en (english, default) is supported]"
_gopass_complete_folders
_gopass_complete_passwords
;;
git)
local -a subcommands
subcommands=(
"init:Initialize git repository"
)
_describe -t commands "gopass git" subcommands
_arguments : "--store[Store to operate on]"
;;
grep)
_arguments : "--regexp[Interpret pattern as RE2 regular expression]"
;;
history|hist)
_arguments : "--password[Include passwords in output]"
;;
init)
_arguments : "--path[Set the sub-store path to operate on]" "--store[Set the name of the sub-store]" "--crypto[Select crypto backend \[age gpgcli plain\]]" "--storage[Select storage backend \[fs gitfs\]]" "--remote[URL of remote Git repository for this store]"
;;
insert)
_arguments : "--echo[Display secret while typing]" "--multiline[Insert using $EDITOR]" "--force[Overwrite any existing secret and do not prompt to confirm recipients]" "--append[Append data read from STDIN to existing data]"
_gopass_complete_folders
_gopass_complete_passwords
;;
link|ln|symlink)
;;
list|ls)
_arguments : "--limit[Display no more than this many levels of the tree]" "--flat[Print a flat list]" "--folders[Print a flat list of folders]" "--strip-prefix[Strip this prefix from filtered entries]"
_gopass_complete_folders
;;
merge)
_arguments : "--delete[Remove merged entries]" "--force[Skip editor, merge entries unattended]"
;;
mounts)
local -a subcommands
subcommands=(
"add:Mount a password store"
"remove:Umount an mounted password store"
"versions:Display mount provider versions"
)
_describe -t commands "gopass mounts" subcommands
;;
move|mv)
_arguments : "--force[Force to move the secret and overwrite existing one]"
_gopass_complete_passwords
;;
otp|totp|hotp)
_arguments : "--clip[Copy the time-based token into the clipboard]" "--qr[Write QR code to `FILE`]" "--continuous[Display tokens continuously until interrupted]"
;;
process)
;;
pwgen)
_arguments : "--no-numerals[Do not include numerals in the generated passwords.]" "--no-capitalize[Do not include capital letter in the generated passwords.]" "--ambiguous[Do not include characters that could be easily confused with each other, like '1' and 'l' or '0' and 'O']" "--symbols[Include at least one symbol in the password.]" "--one-per-line[Print one password per line]" "--xkcd[Use multiple random english words combined to a password. By default, space is used as separator and all words are lowercase]" "--sep[Word separator for generated xkcd style password. If no separator is specified, the words are combined without spaces/separator and the first character of words is capitalised. This flag implies -xkcd]" "--lang[Language to generate password from, currently only en (english, default) is supported]"
;;
recipients)
local -a subcommands
subcommands=(
"add:Add any number of Recipients to any store"
"remove:Remove any number of Recipients from any store"
)
_describe -t commands "gopass recipients" subcommands
;;
show)
_arguments : "--yes[Always answer yes to yes/no questions]" "--clip[Copy the password value into the clipboard]" "--qr[Print the password as a QR Code]" "--password[Display only the password. Takes precedence over all other flags.]" "--revision[Show a past revision. Does NOT support Git shortcuts. Use exact revision or -<N> to select the Nth oldest revision of this entry.]" "--noparsing[Do not parse the output.]" "--chars[Print specific characters from the secret]"
_gopass_complete_passwords
;;
sum|sha|sha256)
;;
sync)
_arguments : "--store[Select the store to sync]"
;;
templates)
local -a subcommands
subcommands=(
"show:Show a secret template."
"edit:Edit secret templates."
"remove:Remove secret templates."
)
_describe -t commands "gopass templates" subcommands
;;
unclip)
_arguments : "--timeout[Time to wait]" "--force[Clear clipboard even if checksum mismatches]"
;;
version)
;;
help|h)
;;
*)
_gopass_complete_passwords
;;
esac
else
local -a subcommands
subcommands=(
"age:age commands"
"audit:Decrypt all secrets and scan for weak or leaked passwords"
"cat:Decode and print content of a binary secret to stdout, or encode and insert from stdin"
"clone:Clone a password store from a git repository"
"completion:Bash and ZSH completion"
"config:Display and edit the configuration file"
"copy:Copy secrets from one location to another"
"create:Easy creation of new secrets"
"delete:Remove one or many secrets from the store"
"edit:Edit new or existing secrets"
"find:Search for secrets"
"fsck:Check store integrity"
"fscopy:Copy files from or to the password store"
"fsmove:Move files from or to the password store"
"generate:Generate a new password"
"git:Run a git command inside a password store"
"grep:Search for secrets files containing search-string when decrypted."
"history:Show password history"
"init:Initialize new password store."
"insert:Insert a new secret"
"link:Create a symlink"
"list:List existing secrets"
"merge:Merge multiple secrets into one"
"mounts:Edit mounted stores"
"move:Move secrets from one location to another"
"otp:Generate time- or hmac-based tokens"
"process:Process a template file"
"pwgen:Generate passwords"
"recipients:Edit recipient permissions"
"show:Display the content of a secret"
"sum:Compute the SHA256 checksum"
"sync:Sync all local stores with their remotes"
"templates:Edit templates"
"unclip:Internal command to clear clipboard"
"version:Display version"
"help:Shows a list of commands or help for one command"
)
_describe -t command 'gopass' subcommands
_arguments : "--yes[Always answer yes to yes/no questions]" "--clip[Copy the password value into the clipboard]" "--qr[Print the password as a QR Code]" "--password[Display only the password. Takes precedence over all other flags.]" "--revision[Show a past revision. Does NOT support Git shortcuts. Use exact revision or -<N> to select the Nth oldest revision of this entry.]" "--noparsing[Do not parse the output.]" "--chars[Print specific characters from the secret]" "--help[show help]" "--version[print the version]"
_gopass_complete_passwords
fi
}
_gopass_complete_keys () {
local IFS=$'\n'
_values 'gpg keys' $(gpg2 --list-secret-keys --with-colons 2> /dev/null | cut -d : -f 10 | sort -u | sed '/^$/d')
}
_gopass_complete_passwords () {
local IFS=$'\n'
_arguments : \
"--clip[Copy the first line of the secret into the clipboard]"
_values 'passwords' $(gopass ls --flat)
}
_gopass_complete_folders () {
local -a folders
folders=("${(@f)$(gopass ls --folders --flat)}")
_describe -t folders "folders" folders -qS /
}
_gopass