forked from withfig/autocomplete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrex.ts
120 lines (119 loc) · 3.47 KB
/
grex.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: "grex",
description:
"Command-line tool for generating regular expressions from user-provided test cases",
options: [
{
name: ["-d", "--digits"],
description: "Converts any Unicode decimal digit to \\d",
},
{
name: ["-D", "--non-digits"],
description:
"Converts any character which is not a Unicode decimal digit to \\D",
},
{
name: ["-s", "--spaces"],
description: "Converts any Unicode whitespace character to \\s",
},
{
name: ["-S", "--non-spaces"],
description:
"Converts any character which is not a Unicode whitespace character to \\S",
},
{
name: ["-w", "--words"],
description: "Converts any Unicode word character to \\w",
},
{
name: ["-W", "--non-words"],
description:
"Converts any character which is not a Unicode word character to \\W",
},
{
name: ["-r", "--repetitions"],
description:
"Detects repeated non-overlapping substrings and converts them to {min,max} quantifier notation",
},
{
name: ["-e", "--escape"],
description:
"Replaces all non-ASCII characters with unicode escape sequences",
},
{
name: "--with-surrogates",
description:
"Converts astral code points to surrogate pairs if --escape is set",
},
{
name: ["-i", "--ignore-case"],
description:
"Performs case-insensitive matching, letters match both upper and lower case",
},
{
name: ["-g", "--capture-groups"],
description: "Replaces non-capturing groups by capturing ones",
},
{
name: ["-c", "--colorize"],
description:
"Provides syntax highlighting for the resulting regular expression",
},
{
name: ["-h", "--help"],
description: "Prints help information",
},
{
name: ["-v", "--version"],
description: "Prints version information",
},
{
name: ["-f", "--file"],
description: "Reads test cases on separate lines from a file",
args: {
template: "filepaths",
},
},
{
name: "--min-repetitions",
description:
"Specifies the minimum quantity of substring repetitions to be converted if --repetitions is set [default: 1]",
args: {
name: "QUANTITY",
suggestions: [
{ name: "1", icon: "🔢" },
{ name: "2", icon: "🔢" },
{ name: "3", icon: "🔢" },
{ name: "4", icon: "🔢" },
{ name: "5", icon: "🔢" },
{ name: "6", icon: "🔢" },
{ name: "7", icon: "🔢" },
{ name: "8", icon: "🔢" },
{ name: "9", icon: "🔢" },
{ name: "10", icon: "🔢" },
],
},
},
{
name: "--min-substring-length",
description:
"Specifies the minimum length a repeated substring must have in order to be converted if --repetitions is set [default: 1]",
args: {
name: "LENGTH",
suggestions: [
{ name: "1", icon: "🔢" },
{ name: "2", icon: "🔢" },
{ name: "3", icon: "🔢" },
{ name: "4", icon: "🔢" },
{ name: "5", icon: "🔢" },
{ name: "6", icon: "🔢" },
{ name: "7", icon: "🔢" },
{ name: "8", icon: "🔢" },
{ name: "9", icon: "🔢" },
{ name: "10", icon: "🔢" },
],
},
},
],
};
export default completionSpec;