style(SearchCommand): Adjusted formatting
This commit is contained in:
parent
995ef1aed9
commit
e27427dfbf
1 changed files with 10 additions and 10 deletions
|
|
@ -4,8 +4,8 @@ import (
|
|||
"github.com/olekukonko/tablewriter"
|
||||
"github.com/urfave/cli/v2"
|
||||
"lpm-cli/Lotus"
|
||||
proto "lpm-cli/Proto/lpm/go"
|
||||
"lpm-cli/ProtoHandler"
|
||||
proto "lpm-cli/proto/lpm/go"
|
||||
"os"
|
||||
)
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ func NewSearchCommand() *cli.Command {
|
|||
|
||||
logger := Lotus.Logger("searchCommand")
|
||||
|
||||
return &cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "search",
|
||||
Usage: "Seaches a packages",
|
||||
Description: "Sends a search request to the default registry server, or to a user-defined registry server",
|
||||
|
|
@ -22,7 +22,7 @@ func NewSearchCommand() *cli.Command {
|
|||
|
||||
var query string
|
||||
|
||||
if len(os.Args) > 3{
|
||||
if len(os.Args) > 3 {
|
||||
query = os.Args[2] + " " + os.Args[3]
|
||||
} else {
|
||||
query = os.Args[2]
|
||||
|
|
@ -43,7 +43,7 @@ func NewSearchCommand() *cli.Command {
|
|||
return nil
|
||||
},
|
||||
OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error {
|
||||
if err != nil{
|
||||
if err != nil {
|
||||
logger.Fatal(err)
|
||||
}
|
||||
return err
|
||||
|
|
@ -73,8 +73,8 @@ func SearchPackages(platform string, architecture []string, query string) []Prot
|
|||
|
||||
for _, reg := range registries {
|
||||
res := fetchPackages(platform, architecture, query, reg)
|
||||
if res != nil{
|
||||
for _, pkg := range protoWrap.ParsePackages(res, reg){
|
||||
if res != nil {
|
||||
for _, pkg := range protoWrap.ParsePackages(res, reg) {
|
||||
packages = append(packages, pkg)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue