this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

allow `goat firehose` to accept source url as positional arg

+13 -1
+13 -1
cmd/goat/firehose.go
··· 4 4 "bytes" 5 5 "context" 6 6 "encoding/json" 7 + "errors" 7 8 "fmt" 8 9 "log/slog" 9 10 "net/http" ··· 78 79 CollectionFilter: cctx.StringSlice("collection"), 79 80 } 80 81 81 - relayHost := cctx.String("relay-host") 82 + var relayHost string 83 + if cctx.IsSet("relay-host") { 84 + relayHost = cctx.String("relay-host") 85 + } else { 86 + if cctx.Args().Len() == 1 { 87 + relayHost = cctx.Args().First() 88 + } else if cctx.Args().Len() > 1 { 89 + return errors.New("can only have at most one relay-host") 90 + } else { 91 + relayHost = cctx.String("relay-host") 92 + } 93 + } 82 94 83 95 dialer := websocket.DefaultDialer 84 96 u, err := url.Parse(relayHost)