-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathtree.ts
251 lines (251 loc) · 5.94 KB
/
tree.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
const completionSpec: Fig.Spec = {
name: "tree",
description: "Display directories as trees (with optional color/HTML output)",
args: {
template: "folders",
},
options: [
{
name: "-a",
description: "All files are listed",
},
{
name: "-d",
description: "List directories only",
},
{
name: "-l",
description: "Follow symbolic links like directories",
},
{
name: "-f",
description: "Print the full path prefix for each file",
},
{
name: "-x",
description: "Stay on current filesystem only",
},
{
name: "-L",
description: "Descend only level directories deep",
args: {
name: "level",
},
},
{
name: "-R",
description: "Rerun tree when max dir level reached",
},
{
name: "-P",
description: "List only those files that match the pattern given",
args: {
name: "pattern",
},
},
{
name: "-I",
description: "Do not list files that match the given pattern",
args: {
name: "pattern",
},
},
{
name: "--ignore-case",
description: "Ignore case when pattern matching",
},
{
name: "--matchdirs",
description: "Include directory names in -P pattern matching",
},
{
name: "--noreport",
description: "Turn off file/directory count at end of tree listing",
},
{
name: "--charset",
description:
"Use charset X for terminal/HTML and indentation line output",
args: {
name: "charset",
},
},
{
name: "--filelimit",
description: "Do not descend dirs with more than # files in them",
args: {
name: "number",
description: "Number of files",
},
},
{
name: "--timefmt",
description: "Print and format time according to the format <f>",
args: {
name: "format",
description: "Format in strftime syntax",
},
},
{
name: "-o",
description: "Output to file instead of stdout",
args: {
name: "filename",
},
},
{
name: "-q",
description: "Print non-printable characters as '?'",
},
{
name: "-N",
description: "Print non-printable characters as is",
},
{
name: "-Q",
description: "Quote filenames with double quotes",
},
{
name: "-p",
description: "Print the protections for each file",
},
{
name: "-u",
description: "Displays file owner or UID number",
},
{
name: "-g",
description: "Displays file group owner or GID number",
},
{
name: "-s",
description: "Print the size in bytes of each file",
},
{
name: "-h",
description: "Print the size in a more human readable way",
},
{
name: "--si",
description: "Like -h but use SI units (powers of 1000) instead",
},
{
name: "--du",
description:
"For each directory report its size as the accumulation of sizes of all its files and sub-directories (and their files, and so on). The total amount of used space is also given in the final report (like the 'du -c' command.) This option requires tree to read the entire directory tree before emitting it, see BUGS AND NOTES below. Implies -s",
},
{
name: "-D",
description:
"Print the date of the last modification time or if -c is used, the last status change time for the file listed",
},
{
name: "-F",
description: "Appends '/', '=', '*', '@', '|' or '>' as per ls -F",
},
{
name: "--inodes",
description: "Print inode number of each file",
},
{
name: "--device",
description: "Print device ID number to which each file belongs",
},
{
name: "-v",
description: "Sort files alphanumerically by version",
},
{
name: "-t",
description: "Sort files by last modification time",
},
{
name: "-c",
description: "Sort files by last status change time",
},
{
name: "-U",
description: "Leave files unsorted",
},
{
name: "-r",
description: "Reverse the order of the sort",
},
{
name: "--dirsfirst",
description: "List directories before files (-U disables)",
},
{
name: "--sort",
description: "Select sort",
requiresSeparator: true,
args: {
name: "type",
suggestions: ["name", "version", "size", "mtime", "ctime"],
},
},
{
name: "-i",
description: "Don't print indentation lines",
},
{
name: "-A",
description: "Print ANSI lines graphic indentation lines",
},
{
name: "-S",
description: "Print with CP437 (console) graphics indentation lines",
},
{
name: "-n",
description: "Turn colorization off always (-C overrides)",
},
{
name: "-C",
description: "Turn colorization on always",
},
{
name: "-X",
description: "Prints out an XML representation of the tree",
},
{
name: "-J",
description: "Prints out an JSON representation of the tree",
},
{
name: "-H",
description: "Prints out HTML format with baseHREF as top directory",
args: {
name: "baseHREF",
},
},
{
name: "-T",
description: "Replace the default HTML title and H1 header with string",
args: {
name: "title",
},
},
{
name: "--nolinks",
description: "Turn off hyperlinks in HTML output",
},
{
name: "--fromfile",
description: "Reads paths from files",
},
{
name: "--version",
description: "Print version and exit",
},
{
name: "--help",
description: "Print usage and this help message and exit",
},
{
name: "--",
description: "Options processing terminator",
},
],
};
export default completionSpec;