Updated SearchCommand to new structure

This commit is contained in:
netbenix 2021-11-09 10:41:11 +01:00
parent 65f2051a5e
commit 450167cd54

View file

@ -1,8 +1,8 @@
package Commands package Commands
import ( import (
"github.com/urfave/cli/v2"
"github.com/olekukonko/tablewriter" "github.com/olekukonko/tablewriter"
"github.com/urfave/cli/v2"
"lpm-cli/Lotus" "lpm-cli/Lotus"
"lpm-cli/ProtoHandler" "lpm-cli/ProtoHandler"
"os" "os"
@ -26,7 +26,7 @@ func NewSearchCommand() *cli.Command {
table.SetHeader([]string{"Publisher", "Package", "Description", "Latest Version", "Registry"}) table.SetHeader([]string{"Publisher", "Package", "Description", "Latest Version", "Registry"})
for _, pkg := range packages { for _, pkg := range packages {
table.Append([]string{pkg.Publisher, pkg.Name, pkg.Description, pkg.Version, "[core]"}) table.Append([]string{pkg.PackageMetadata.Publisher, pkg.PackageMetadata.Name, pkg.PackageMetadata.Description, pkg.PackageMetadata.Version, pkg.Register.Register})
} }
table.Render() table.Render()
//Sample code end //Sample code end