@@ -200,69 +200,7 @@ const Command = struct {
200200 log_filter_scopes : ? []log.Scope = null ,
201201 };
202202
203- fn printUsageAndExit (self : * const Command , success : bool ) void {
204- const common_options =
205- \\
206- \\--insecure_disable_tls_host_verification
207- \\ Disables host verification on all HTTP requests.
208- \\ This is an advanced option which should only be
209- \\ set if you understand and accept the risk of
210- \\ disabling host verification.
211- \\
212- \\--http_proxy The HTTP proxy to use for all HTTP requests.
213- \\ Defaults to none.
214- \\
215- \\--log_level The log level: debug, info, warn, error or fatal.
216- \\ Defaults to
217- ++ (if (builtin .mode == .Debug ) " info." else "warn." ) ++
218- \\
219- \\
220- \\--log_format The log format: pretty or logfmt.
221- \\ Defaults to
222- ++ (if (builtin .mode == .Debug ) " pretty." else " logfmt." ) ++
223- \\
224- \\
225- ;
226-
227- const usage =
228- \\usage: {s} command [options] [URL]
229- \\
230- \\Command can be either 'fetch', 'serve' or 'help'
231- \\
232- \\fetch command
233- \\Fetches the specified URL
234- \\Example: {s} fetch --dump https://lightpanda.io/
235- \\
236- \\Options:
237- \\--dump Dumps document to stdout.
238- \\ Defaults to false.
239- \\
240- ++ common_options ++
241- \\
242- \\serve command
243- \\Starts a websocket CDP server
244- \\Example: {s} serve --host 127.0.0.1 --port 9222
245- \\
246- \\Options:
247- \\--host Host of the CDP server
248- \\ Defaults to "127.0.0.1"
249- \\
250- \\--port Port of the CDP server
251- \\ Defaults to 9222
252- \\
253- \\--timeout Inactivity timeout in seconds before disconnecting clients
254- \\ Defaults to 3 (seconds)
255- \\
256- ++ common_options ++
257- \\
258- \\version command
259- \\Displays the version of {s}
260- \\
261- \\help command
262- \\Displays this message
263- \\
264- ;
265- std .debug .print (usage , .{ self .exec_name , self .exec_name , self .exec_name , self .exec_name });
203+ fn printUsageAndExit (_ : * const Command , success : bool ) void {
266204 if (success ) {
267205 return std .process .cleanExit ();
268206 }
0 commit comments