aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/swextreload/main.go40
1 files changed, 39 insertions, 1 deletions
diff --git a/cmd/swextreload/main.go b/cmd/swextreload/main.go
index 0d111f8..b1702f6 100644
--- a/cmd/swextreload/main.go
+++ b/cmd/swextreload/main.go
@@ -3,11 +3,49 @@ package main
import (
"log"
+ "git.sr.ht/~liliace/claw"
swextreload "gopkg.teddywing.com/swextreload/internal"
)
func main() {
- err := swextreload.Reload(
+ args, err := claw.Parse(&claw.Options{
+ Name: "swextreload",
+ Description: "Reload Google Chrome extensions.",
+ Flags: []claw.Flag{
+ {
+ LongName: "socket-url",
+ Type: "string",
+ Description: "DevTools protocol WebSocket URL",
+ },
+ {
+ LongName: "reload-current-tab",
+ Type: "bool",
+ Description: "pass this to reload the active Chrome tab",
+ },
+ {
+ LongName: "version",
+ ShortName: 'V',
+ Type: "bool",
+ Description: "show the program version",
+ },
+ },
+ Positionals: []claw.Positional{
+ {
+ Name: "extension_id",
+ Type: "string",
+ Repeating: true,
+ Description: "extensions to reload",
+ },
+ },
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ log.Printf("args: %#v", args)
+ return
+
+ err = swextreload.Reload(
"ws://127.0.0.1:55755/devtools/browser/4536efdf-6ddf-40b6-9a16-258a1935d866",
"imcibeelfmccdpnnlemllnepgbfdbkgo",
true,