-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathsysctl.ts
82 lines (80 loc) · 1.89 KB
/
sysctl.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
const generateSysctlNames: Fig.Generator = {
script: ["sysctl", "-A", "-N"],
postProcess: (out) => {
return out.split("\n").map((line) => {
return {
name: line,
description: "Variable name",
};
});
},
};
const completionSpec: Fig.Spec = {
name: "sysctl",
description: "Get or set kernel state",
options: [
{
name: ["-A", "-a"],
description: "List all the currently available non-opaque values",
},
{
name: "-b",
description:
"Force the value of the variable(s) to be output in raw, binary format",
},
{
name: "-d",
description: "Print the description of the variable instead of its value",
},
{
name: "-e",
description:
"Separate the name and the value of the variable(s) with '='",
args: {
name: "variable",
isVariadic: true,
},
},
{
name: "-h",
description: "Format output for human, rather than machine, readability",
},
{
name: "-i",
description: "Ignore unknown OIDs",
},
{
name: "-N",
description: "Show only variable names, not their values",
},
{
name: "-n",
description: "Show only variable values, not their names",
},
{
name: "-o",
description: "Show opaque variables (which are normally suppressed)",
},
{
name: "-q",
description:
"Suppress some warnings generated by sysctl to standard error",
},
{
name: "-X",
description: "Equivalent to -x -a (for compatibility)",
},
{
name: "-x",
description:
"As -o, but prints a hex dump of the entire value instead of just the first few bytes",
},
],
args: {
name: "Variable names (and values if available)",
isVariadic: true,
isOptional: true,
generators: generateSysctlNames,
},
};
export default completionSpec;