Add explicit commands to binary

./lightpanda serve --host ...
./lightpanda fetch https://...

Makes it easier to communicate / document which command has which options.

Internally added a "usage" command for displaying the usage - removing the need
for error.NoError :|
This commit is contained in:
Karl Seguin
2025-02-21 17:15:14 +08:00
parent 908febb363
commit d8f7817eeb
2 changed files with 195 additions and 178 deletions

View File

@@ -61,7 +61,7 @@ chmod a+x ./lightpanda
### Dump an URL
```console
./lightpanda --dump https://lightpanda.io
./lightpanda fetch --dump https://lightpanda.io
```
```console
info(browser): GET https://lightpanda.io/ http.Status.ok
@@ -73,7 +73,7 @@ info(browser): eval remote https://api.website.lightpanda.io/js/script.js: TypeE
### Start a CDP server
```console
./lightpanda --host 127.0.0.1 --port 9222
./lightpanda serve --host 127.0.0.1 --port 9222
```
```console
info(websocket): starting blocking worker to listen on 127.0.0.1:9222