style(SearchCommand): Adjusted formatting

This commit is contained in:
netbenix 2022-08-27 12:48:20 +02:00
parent 995ef1aed9
commit e27427dfbf

View file

@ -4,8 +4,8 @@ import (
"github.com/olekukonko/tablewriter" "github.com/olekukonko/tablewriter"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
"lpm-cli/Lotus" "lpm-cli/Lotus"
proto "lpm-cli/Proto/lpm/go"
"lpm-cli/ProtoHandler" "lpm-cli/ProtoHandler"
proto "lpm-cli/proto/lpm/go"
"os" "os"
) )
@ -13,7 +13,7 @@ func NewSearchCommand() *cli.Command {
logger := Lotus.Logger("searchCommand") logger := Lotus.Logger("searchCommand")
return &cli.Command { return &cli.Command{
Name: "search", Name: "search",
Usage: "Seaches a packages", Usage: "Seaches a packages",
Description: "Sends a search request to the default registry server, or to a user-defined registry server", 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 var query string
if len(os.Args) > 3{ if len(os.Args) > 3 {
query = os.Args[2] + " " + os.Args[3] query = os.Args[2] + " " + os.Args[3]
} else { } else {
query = os.Args[2] query = os.Args[2]
@ -43,7 +43,7 @@ func NewSearchCommand() *cli.Command {
return nil return nil
}, },
OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error { OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error {
if err != nil{ if err != nil {
logger.Fatal(err) logger.Fatal(err)
} }
return err return err
@ -73,8 +73,8 @@ func SearchPackages(platform string, architecture []string, query string) []Prot
for _, reg := range registries { for _, reg := range registries {
res := fetchPackages(platform, architecture, query, reg) res := fetchPackages(platform, architecture, query, reg)
if res != nil{ if res != nil {
for _, pkg := range protoWrap.ParsePackages(res, reg){ for _, pkg := range protoWrap.ParsePackages(res, reg) {
packages = append(packages, pkg) packages = append(packages, pkg)
} }
} }