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 (#980)

authored by

bnewbold and committed by
GitHub
cb0394f3 aa8c2ee9

+16 -1
+16 -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 + if cctx.Args().Len() != 0 { 85 + return errors.New("error: unused positional args") 86 + } 87 + relayHost = cctx.String("relay-host") 88 + } else { 89 + if cctx.Args().Len() == 1 { 90 + relayHost = cctx.Args().First() 91 + } else if cctx.Args().Len() > 1 { 92 + return errors.New("can only have at most one relay-host") 93 + } else { 94 + relayHost = cctx.String("relay-host") 95 + } 96 + } 82 97 83 98 dialer := websocket.DefaultDialer 84 99 u, err := url.Parse(relayHost)