-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathwatchman.ts
287 lines (286 loc) · 7.32 KB
/
watchman.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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
const completionSpec: Fig.Spec = {
name: "watchman",
description: "A file watching service",
subcommands: [
{
name: "clock",
description: "Returns the current clock value for a watched root",
args: {
name: "path",
description: "The path to directory",
template: "folders",
},
},
{
name: "find",
description:
"Finds all files that match the optional list of patterns under the specified dir",
args: {
name: "path",
description: "The path to directory",
isVariadic: true,
template: "folders",
},
},
{
name: "flush-subscriptions",
description:
"This is designed to be used by interactive programs that have a background process or daemon maintaining a subscription to Watchman",
},
{
name: "get-config",
description: "Returns the .watchmanconfig for the root",
subcommands: [
{
name: "path",
description: "The path to root",
},
],
},
{
name: "get-sockname",
description: "Get socket path",
},
{
name: "list-capabilities",
description:
"Returns the full list of supported capabilities offered by the watchman server",
},
{
name: "log",
description: "Generates a log line in the watchman log",
args: {
name: "level",
description: "The log level",
suggestions: ["debug", "error", "off"],
},
},
{
name: "log-level",
description:
"Changes the log level of your connection to the watchman service",
args: {
name: "level",
description: "The log level",
suggestions: ["debug", "error", "off"],
},
},
{
name: "query",
description: "Executes a query against the specified root",
},
{
name: "shutdown-server",
description:
"This causes your watchman service to exit with a normal status code",
},
{
name: "since",
description:
"Finds all files that were modified since the specified clockspec that match the optional list of patterns",
args: {
name: "path",
description: "The path to directory",
template: "folders",
},
},
{
name: "state-enter",
description:
"This causes a watch to be marked as being in a particular named state",
},
{
name: "state-leave",
description:
"This causes a watch to no longer be marked as being in a particular named state",
},
{
name: "subscribe",
description:
"Subscribes to changes against a specified root and requests that they be sent to the client via its connection",
},
{
name: "trigger",
description: "This will create or replace a trigger",
args: {
name: "path",
description: "The path to directory",
template: "folders",
},
},
{
name: "trigger-del",
description:
"Deletes a named trigger from the list of registered triggers",
},
{
name: "trigger-list",
description:
"Returns the set of registered triggers associated with a root directory",
},
{
name: "unsubscribe",
description: "Cancels a named subscription against the specified root",
},
{
name: "version",
description:
"The version and build information for the currently running watchman service",
},
{
name: "watch-del",
description: "Removes a watch and any associated triggers",
args: {
name: "path",
description: "The path to directory",
template: "folders",
},
},
{
name: "watch-del-all",
description: "Removes all watches and associated triggers",
},
{
name: "watch-list",
description: "Returns a list of watched dirs",
},
{
name: "watch-project",
description:
"Requests that the project containing the requested dir is watched for changes",
},
],
options: [
{
name: ["--help", "-h"],
description: "Show help for watchman",
},
{
name: "--inetd",
description: "Spawning from an inetd style supervisor",
},
{
name: ["-S", "--no-site-spawner"],
description: "Don't use the site or system spawner",
},
{
name: ["-v", "--version"],
description: "Show version number for watchman",
},
{
name: "--named-pipe-path",
description: "Specify alternate named pipe path",
requiresSeparator: true,
args: {
name: "path",
description: "The alternate named pipe path",
},
},
{
name: "-u",
description: "Specify alternate unix domain socket path",
args: {
name: "path",
description: "The alternate unix domain socket path",
},
},
{
name: "--unix-listener-path",
description: "Specify alternate unix domain socket path",
requiresSeparator: true,
args: {
name: "path",
description: "The alernate unix domain socket path",
},
},
{
name: "-o",
description: "Specify the path to logfile",
args: {
name: "path",
description: "The path to logfile",
},
},
{
name: "--logfile",
description: "Specify the path to logfile",
requiresSeparator: true,
args: {
name: "path",
description: "The path to logfile",
},
},
{
name: "--log-level",
description: "Set the log level",
args: {
name: "level",
description: "The log level",
suggestions: ["0", "1", "2"],
},
},
{
name: "--pidfile",
description: "Specify path to pidfile",
},
{
name: ["-p", "--persistent"],
description: "Persist and wait for further responses",
},
{
name: ["-n", "--no-save-state"],
description: "Don't save state between invocations",
},
{
name: "--statefile",
description: "Specify path to file to hold watch and trigger state",
args: {
name: "path",
description: "The path to file to hold watch and trigger state",
},
},
{
name: ["-j", "--json-command"],
description:
"Instead of parsing CLI arguments, take a single json object from stdin",
},
{
name: "--output-encoding",
description: "CLI output encoding",
requiresSeparator: true,
args: {
name: "encoding",
description: "The output encoding",
suggestions: ["json", "bser"],
},
},
{
name: "--server-encoding",
description: "CLI<->server encoding",
requiresSeparator: true,
args: {
name: "encoding",
description: "The server encoding",
suggestions: ["bser", "json"],
},
},
{
name: ["-f", "--foreground"],
description: "Run the service in the foreground",
},
{
name: "--no-pretty",
description: "Don't pretty print JSON",
},
{
name: "--no-spawn",
description: "Don't try to start the service if it is not available",
},
{
name: "--no-local",
description:
"When no-spawn is enabled, don't try to handle request in client mode if service is unavailable",
},
],
};
export default completionSpec;