-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathxargs.ts
120 lines (119 loc) · 2.82 KB
/
xargs.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
const completionSpec: Fig.Spec = {
name: "xargs",
description:
"Execute a command with whitespace-delimited strings (from stdin) as arguments",
options: [
{
name: "-0",
description: "Use NUL (0x00) as a separator, instead of whitespace",
},
{
name: "-E",
description: "Use this string as a logical EOF marker",
args: {
name: "eof-str",
description: "The string to use that marks EOF",
},
},
{
name: "-I",
description: "Replace occurrences of this string with the input",
args: {
name: "replacement-str",
description: "The string to replace",
},
},
{
name: "-J",
description:
"Replace an argument exactly equal to this string with the input",
args: {
name: "replacement-str",
description: "The string to replace",
},
},
{
name: "-L",
description:
"Run the program each time this many lines of input are read",
args: {
name: "number",
},
exclusiveOn: ["-n"],
},
{
name: "-n",
description:
"The maximum number of arguments that can be taken from stdin on each run",
args: {
name: "number",
},
exclusiveOn: ["-L"],
},
{
name: "-o",
description:
"Reopen stdin as /dev/tty (useful for running interactive applications)",
},
{
name: "-P",
description:
"Run up to this many commands in parallel (as many as possible if 0)",
args: {
name: "max-procs",
},
},
{
name: "-p",
description: "Prompt to run each command",
},
{
name: "-r",
description:
"Run the command once if there's no input (compatible with GNU xargs)",
},
{
name: "-R",
description:
"Specify the maximum number of occurrences that -I will replace",
dependsOn: ["-I"],
args: {
name: "number",
},
},
{
name: "-S",
description:
"Specify the maximum size in bytes that -I can use for replacements (default: 255)",
dependsOn: ["-I"],
args: {
name: "replacement-size",
},
},
{
name: "-s",
description:
"Maximum number of bytes that can be provided to the program (default: 4096)",
args: {
name: "max-args-size",
},
},
{
name: "-t",
description: "Echo the command to stderr before it's executed",
},
{
name: "-x",
description:
"Terminal if the arguments will not fit in the maximum line length",
dependsOn: ["-n"],
},
],
args: {
name: "utility",
description: "Run this program for each line of stdin (default: echo)",
isCommand: true,
isOptional: true,
},
};
export default completionSpec;