about summary refs log tree commit diff
path: root/Completion/Solaris/Command/_coreadm
blob: 7cf529a4f05357279cd05ae662d59ef9fac31693 (plain) (blame)
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
#compdef coreadm

_coreadm() {
	local -a content option

	content=(
		"anon[Anonymous private mappings]"
		"ctf[CTF type information]"
		"data[Writable private file mappings]"
		"dism[DISM mappings]"
		"heap[Process heap]"
		"ism[ISM mappings]"
		"rodata[Read-only private file mappings]"
		"shanon[Anonymous shared mappings]"
		"shfile[File-backed shared mappings]"
		"shm[System V shared memory]"
		"stack[Process stack]"
		"symtab[Symbol table sections for loaded files]"
		"text[Readable and executable private file mappings]"
	)

	option=(
		"global"\:"Allow global core dumps"
		"global-setid"\:"Allow set-id global core dumps"
		"log"\:"Generate a syslog message on global core dump"
		"process"\:"Allow per-process core dumps"
		"proc-setid"\:"Allow set-id per-process core dumps"
	)

	# _values doesn't quite work for us here -- the separator can be either
	# "+" or "-"
	_arguments -s \
		- set1 \
		'-g[Global core file name pattern]:' \
		'-G[Global core file content]:content:_values -s + "content" $content' \
		'-i[Per-process core file name pattern]:' \
		'-I[Per-process core file content]:content:_values -s + "content" $content' \
		'*-d[Disable core option]:option:(($option))' \
		'*-e[Enable core option]:option:(($option))' \
		- set2 \
		'-p[PID-specific per-process core file name pattern]:' \
		'-P[PID-specific per-process core file content]:content:_values -s + "content" $content' \
		'*:pids:_pids' \
		- set3 \
		'-u[Update options from coreadm.conf]'
}

_coreadm "$@"