Dynamic Search whoop whoop
This commit is contained in:
parent
f848f8ab14
commit
d762d70c78
1 changed files with 10 additions and 3 deletions
|
|
@ -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
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in a new issue