Lasa is a stateless proxy that generates a RSS or an Atom feed from a Standard.site publication. lasa.anhgelus.world
rss atom atprotocol standard-site atproto
2
fork

Configure Feed

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

feat(cli): exit status code 1 with incomplete args

+12 -6
+1 -1
client.go
··· 15 15 func NewClient(client *http.Client, resolver *net.Resolver, cache valkey.Client, dur time.Duration) xrpc.Client { 16 16 client.Timeout = 30 * time.Second 17 17 dir := NewDirectory(atproto.NewDirectory(client, resolver), cache, dur) 18 - return xrpc.NewClient(client, dir) 18 + return xrpc.NewClient(client, dir, "Lasa/v0.1.0 (Linux; +https://tangled.org/anhgelus.world/lasa)") 19 19 } 20 20 21 21 func ListDocuments(
+7 -5
cmd/lasa/main.go
··· 4 4 "flag" 5 5 "net" 6 6 "net/http" 7 + "os" 7 8 8 9 "tangled.org/anhgelus.world/lasa" 9 10 "tangled.org/anhgelus.world/lasa/cmd/internal" ··· 19 20 } 20 21 21 22 var commands = []internal.Command{ 22 - {Name: "publication", Usage: "works with publication", Callback: handlePublication}, 23 + {Name: "publication", Usage: "display publications", Callback: handlePublication}, 23 24 } 24 25 25 26 var client xrpc.Client ··· 27 28 func main() { 28 29 flag.Parse() 29 30 args := flag.Args() 30 - if len(args) == 0 || help { 31 - handleHelp() 31 + if len(args) == 0 { 32 + handleHelp(nil) 32 33 return 33 34 } 34 35 client = lasa.NewClient(http.DefaultClient, net.DefaultResolver, nil, 0) ··· 43 44 return 44 45 } 45 46 } 46 - handleHelp() 47 + handleHelp(next) 48 + os.Exit(1) 47 49 } 48 50 49 - func handleHelp() { 51 + func handleHelp([]string) { 50 52 internal.Usage( 51 53 `lasa <command>`, 52 54 `Lasa is a CLI tool.`,
+4
cmd/lasa/publication.go
··· 3 3 import ( 4 4 "context" 5 5 "fmt" 6 + "os" 6 7 7 8 site "tangled.org/anhgelus.world/goat-site" 8 9 "tangled.org/anhgelus.world/lasa" ··· 23 24 "lasa publication did:web:example.org fooBar\t-\tdisplay publication of did:web:example.org referenced by fooBar", 24 25 }, 25 26 ) 27 + if !help { 28 + os.Exit(1) 29 + } 26 30 } 27 31 28 32 func handlePublication(args []string) {