summaryrefslogtreecommitdiff
path: root/etc/completions/_envstore
blob: 2f9c18d62f242fab17157603258a708a3bb6f830 (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
#compdef envstore
## vim:ft=zsh

local arguments_action arguments_save arguments_rm arguments_eval

arguments_action=(
	'1:action:(clear eval rm save show)'
)
arguments_save=(
	'2:variable:_parameters -g \*-export'
)
arguments_rm=(
	'2:variable:($(envstore eval -e | cut -d " " -f 2 | cut -d "=" -f 1))'
)
arguments_eval=(
	'2::option:(-e)'
)

if [[ $CURRENT -ge 3 ]] {
	case ${words[2]} in 
		eval)  _arguments -s $arguments_eval ;;
		rm)    _arguments -s $arguments_rm ;;
		save)  _arguments -s $arguments_save ;;
	esac
} else {
	_arguments -s $arguments_action
}