summaryrefslogtreecommitdiff
path: root/etc/completions/_raps2
blob: c48c0cfda15d4172f16f8b379892c0f099041f94 (plain)
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
#compdef raps2

typeset -i NORMARG

function _raps2_action_args {
	if [[ ${words[$NORMARG]} == add ]]; then
		_message 'Account name'

	elif [[ ${words[$NORMARG]} != list ]]; then
		_path_files -W ${XDG_DATA_HOME-${HOME}/.local/share}/raps2/

	fi
}

function _raps2_action {
	typeset -a actions

	actions=(
		'add:Add an account'
		'del:Remove an account'
		'dump:Dump all account data'
		'edit:Edit account'
		'get:Place account password in X clipboard'
		'info:Show account information'
		'list:list accounts'
	)

	_describe 'action' actions
}

_arguments -n ':action:_raps2_action' \
	'*:arguments:_raps2_action_args'