forked from withfig/autocomplete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgoogler.ts
194 lines (193 loc) · 4.64 KB
/
googler.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
const completionSpec: Fig.Spec = {
name: "googler",
description: "Google from the command-line",
options: [
{
name: ["-h", "--help"],
description: "Show this help message and exit",
},
{
name: ["-s", "--start"],
description: "Start at the Nth result",
args: {
name: "N",
},
},
{
name: ["-n", "--count"],
description: "Show N results",
args: {
name: "N",
default: "10",
},
},
{
name: ["-N", "--news"],
description: "Show results from news section",
},
{
name: ["-V", "--videos"],
description: "Show results from videos section",
},
{
name: ["-c", "--tld"],
description:
"Country-specific search with top-level domain .TLD, e.g., 'in' for India",
args: {
name: "top-level domain",
},
},
{
name: ["-l", "--lang"],
description: "Display in language",
args: {
name: "language",
},
},
{
name: ["-g", "--geoloc"],
description:
"Country-specific geolocation search with country code CC, e.g. 'in' for India",
args: {
name: "CC",
description: "Country codes are the same as top-level domains",
},
},
{
name: ["-x", "--exact"],
description: "Disable automatic spelling correction",
},
{
name: "--colorize",
description:
"Whether to colorize output which enables color when stdout is a tty device",
args: {
name: "mode",
default: "auto",
suggestions: ["auto", "always", "never"],
},
},
{
name: ["-C", "--nocolor"],
description: "Equivalent to --colorize=never",
},
{
name: "--colors",
description: "Set output colors",
args: {
name: "colors",
isVariadic: true,
},
},
{
name: ["-j", "--first", "--lucky"],
description: "Open the first result in web browser and exit",
},
{
name: ["-t", "--time"],
description:
"Time limit search [h5 (5 hrs), d5 (5 days), w5 (5 weeks), m5 (5 months), y5 (5 years)",
args: {
name: "time limit",
},
},
{
name: "--from",
description:
"Starting date/month/year of date range. Can be used in conjunction with --to and overrides -t, --time",
args: {
name: "date",
description:
"American date format with slashes, e.g., 2/24/2020, 2/2020, 2020",
},
},
{
name: "--to",
description: "Ending date/month/year of date range",
args: {
name: "date",
description:
"American date format with slashes, e.g., 2/24/2020, 2/2020, 2020",
},
},
{
name: ["-w", "--site"],
description: "Search a site using Google",
args: {
name: "site",
},
},
{
name: ["-e", "--exclude"],
description: "Exclude site from results",
},
{
name: "--unfilter",
description: "Do not omit similar results",
},
{
name: ["-p", "--proxy"],
description: "Tunnel traffic through an HTTP proxy",
args: {
name: "PROXY",
description: "In the form of [http://][user:password@]proxyhost[:port]",
},
},
{
name: "--notweak",
description: "Disable TCP optimizations and forced TLS 1.2",
},
{
name: "--json",
description: "Output in JSON format; implies --noprompt",
dependsOn: ["--noprompt"],
},
{
name: "--url-handler",
description: "Custom script or cli utility to open results",
args: {
name: "util",
},
},
{
name: "--show-browser-logs",
description: "Do not suppress browser output (stdout and stderr)",
},
{
name: ["--np", "--noprompt"],
description: "Search and exit, do not prompt",
},
{
name: ["-4", "--ipv4"],
description:
"Only connect over IPv4 (by default, IPv4 is preferred but IPv6 is used as a fallback)",
},
{
name: ["-6", "--ipv6"],
description: "Only connect over IPv6",
},
{
name: ["-u", "--upgrade"],
description: "Perform in-place self-upgrade",
},
{
name: "--include-git",
description: "When used with --upgrade, get latest git master",
},
{
name: ["-v", "--version"],
description: "Show program's version number and exit",
},
{
name: ["-d", "--debug"],
description: "Enable debugging",
},
],
args: {
name: "keyword",
description: "Search keywords",
isVariadic: true,
isOptional: true,
},
};
export default completionSpec;