-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathpkill.ts
200 lines (200 loc) · 4.32 KB
/
pkill.ts
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
const completionSpec: Fig.Spec = {
name: "pkill",
description:
"Send the specified signal (by default SIGTERM) to each specified process",
options: [
{
name: "--signal",
description: "Signal to send (either number or name)",
args: {
name: "signal",
description: "Signal to send",
suggestions: [
"SIGABRT",
"SIGALRM",
"SIGBUS",
"SIGCHLD",
"SIGCLD",
"SIGCONT",
"SIGEMT",
"SIGFPE",
"SIGHUP",
"SIGILL",
"SIGINFO",
"SIGINT",
"SIGIO",
"SIGIOT",
"SIGKILL",
"SIGLOST",
"SIGPIPE",
"SIGPOLL",
"SIGPROF",
"SIGPWR",
"SIGQUIT",
"SIGSEGV",
"SIGSTKFLT",
"SIGSTOP",
"SIGTSTP",
"SIGSYS",
"SIGTERM",
"SIGTRAP",
"SIGTTIN",
"SIGTTOU",
"SIGUNUSED",
"SIGURG",
"SIGUSR1",
"SIGUSR2",
"SIGVTALRM",
"SIGXCPU",
"SIGXFSZ",
"SIGWINCH",
],
},
},
{
name: ["-q", "--queue"],
description: "Integer value to be sent with the signal",
args: {
name: "value",
},
},
{
name: ["-e", "--echo"],
description: "Display what is killed",
},
{
name: ["-f", "--full"],
description: "Use full process name to match",
},
{
name: ["-g", "--pgroup"],
description: "Match listed process group IDs",
args: {
name: "PGID",
isVariadic: true,
},
},
{
name: ["-G", "--group"],
description: "Match real group IDs",
args: {
name: "GID",
isVariadic: true,
},
},
{
name: ["-i", "--ignore-case"],
description: "Match case insensitively",
},
{
name: ["-n", "--newest"],
description: "Select most recently started",
},
{
name: ["-o", "--oldest"],
description: "Select least recently started",
},
{
name: ["-O", "--older"],
description: "Select where older than seconds",
args: {
name: "seconds",
},
},
{
name: ["-P", "--parent"],
description: "Match only child processes of the given parent",
args: {
name: "PPID",
isVariadic: true,
},
},
{
name: ["-s", "--session"],
description: "Match session IDs",
args: {
name: "SID",
isVariadic: true,
},
},
{
name: ["-t", "--terminal"],
description: "Match by controlling terminal",
args: {
name: "tty",
isVariadic: true,
},
},
{
name: ["-u", "--euid"],
description: "Match by effective IDs",
args: {
name: "ID",
isVariadic: true,
},
},
{
name: ["-U", "--uid"],
description: "Match by real IDs",
args: {
name: "ID",
isVariadic: true,
},
},
{
name: ["-x", "--exact"],
description: "Match exactly with the command name",
},
{
name: ["-F", "--pidfile"],
description: "Read PIDs from file",
args: {
name: "file",
template: "filepaths",
},
},
{
name: ["-L", "logpidfile"],
description: "Fail if PID file is not locked",
},
{
name: ["-r", "--runstates"],
description: "Match runstates",
args: {
name: "state",
},
},
{
name: "--ns",
description: "Match the processes that belong to a specified PID",
args: {
name: "PID",
},
},
{
name: "--nslist",
description:
"List which namespaces will be considered for the --ns option",
dependsOn: ["--ns"],
args: {
name: "ns",
isVariadic: true,
suggestions: ["ipc", "mnt", "net", "pid", "user", "uts"],
},
},
{
name: ["-h", "--help"],
description: "Output help message and exit",
},
{
name: ["-V", "--version"],
description: "Output version information and exit",
},
],
args: {
name: "pattern",
description:
"Specifies an Extended Regular Expression for matching against the process names or command lines",
},
};
export default completionSpec;