File size: 451 Bytes
065fee7
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Complete keyring backends for `keyring -b` from `keyring --list-backends`
# % keyring -b <TAB>
# keyring priority
# keyring.backends.chainer.ChainerBackend   10
# keyring.backends.fail.Keyring             0
# ...                                       ...

backend_complete() {
	local line
	while read -r line; do
		choices+=(${${line/ \(priority: /\\\\:}/)/})
	done <<< "$($words[1] --list-backends)"
	_arguments "*:keyring priority:(($choices))"
}