summaryrefslogtreecommitdiff
path: root/net:foret/completion/_endurance
blob: 1af5d515a5c9103830e2e23ef6ca67a6d3de3b4d (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
#compdef do.sh

_endurance() {

	list-commands () {
		grep '^[[:blank:]]*".*"[[:blank:]]*)' do.sh | tr '")\t|\n' '    ' | tr -s ' '
	}

	list-tests () {
		echo all
		find /mnt/endurancetesting/ -mindepth 1 -maxdepth 1 -type d ! -name '.*' | cut -d'/' -f4
	}

	list-nodes () {
		< /mnt/endurancetesting/planning awk '!/^#|^$/ { if ( ! seen[$1] ) { seen[$1]=1 ; print $1 } }'
	}

	case "$service" in
		do.sh)
		_arguments \
			':actions:(( $(list-commands) ))' \
			':tests:(( $(list-tests) ))' \
			':nodes:(( $(list-nodes) ))'
		_alternative \
			'*:files: _files'
		;;
	esac

}