From d762d70c7881b91836dd03ccd97a76f8b6990b18 Mon Sep 17 00:00:00 2001 From: netbenix Date: Sat, 20 Nov 2021 15:39:52 +0100 Subject: [PATCH] Dynamic Search whoop whoop --- Commands/SearchCommand.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Commands/SearchCommand.go b/Commands/SearchCommand.go index a8d8694..75607fc 100644 --- a/Commands/SearchCommand.go +++ b/Commands/SearchCommand.go @@ -4,7 +4,6 @@ import ( "github.com/olekukonko/tablewriter" "github.com/urfave/cli/v2" "lpm-cli/Lotus" - "lpm-cli/ProtoHandler" "os" ) @@ -19,7 +18,15 @@ func NewSearchCommand() *cli.Command { HelpName: "search", Action: func(c *cli.Context) error { - packages := ProtoHandler.SearchPackages("a platform", []string{"amd64", "i386"}, "chrome") + var query string + + if len(os.Args) > 3{ + query = os.Args[2] + " " + os.Args[3] + } else { + query = os.Args[2] + } + + packages := SearchPackages(Lotus.Platform(), Lotus.Architecture(), query) //sample code table := tablewriter.NewWriter(os.Stdout) @@ -40,4 +47,4 @@ func NewSearchCommand() *cli.Command { return err }, } -} +} \ No newline at end of file