From 2da9224baae34062e7e15369d6456278278910cf Mon Sep 17 00:00:00 2001 From: Sergio Rubio Date: Sun, 18 Aug 2024 21:07:49 +0200 Subject: [PATCH] Fix API --- cmd/omnivore/main.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/omnivore/main.go b/cmd/omnivore/main.go index 09cf4b5..9498b3b 100644 --- a/cmd/omnivore/main.go +++ b/cmd/omnivore/main.go @@ -6,6 +6,8 @@ import ( "os" "strings" + "context" + "github.com/rubiojr/omnivore-go" "github.com/urfave/cli/v2" ) @@ -14,9 +16,6 @@ func main() { app := &cli.App{ Name: "omnivore", Usage: "Omnivore API client", - Action: func(*cli.Context) error { - return nil - }, Flags: []cli.Flag{}, Commands: []*cli.Command{ { @@ -44,7 +43,7 @@ func listSaved(ctx *cli.Context) { longFormat := ctx.Bool("long") client := omnivore.NewClient(omnivore.Opts{Token: getAPIToken()}) // https://docs.omnivore.app/using/search.html - a, err := client.Search(omnivore.SearchOpts{Query: "in:all sort:saved"}) + a, err := client.Search(context.Background(), omnivore.SearchOpts{Query: "in:all sort:saved"}) if err != nil { log.Fatalf("Failed to search: %v", err) }