mirror of
https://github.com/mudler/luet.git
synced 2025-07-16 00:15:59 +00:00
Use different result structs in pkglist
This commit is contained in:
parent
937609a9f4
commit
20aa7c89f8
@ -31,14 +31,14 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
type PackageResult struct {
|
||||
type TreePackageResult struct {
|
||||
Name string `json:"name"`
|
||||
Category string `json:"category"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
type Results struct {
|
||||
Packages []PackageResult `json:"packages"`
|
||||
type TreeResults struct {
|
||||
Packages []TreePackageResult `json:"packages"`
|
||||
}
|
||||
|
||||
func pkgDetail(pkg pkg.Package) string {
|
||||
@ -75,7 +75,7 @@ func NewTreePkglistCommand() *cobra.Command {
|
||||
}
|
||||
},
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
var results Results
|
||||
var results TreeResults
|
||||
|
||||
treePath, _ := cmd.Flags().GetString("tree")
|
||||
verbose, _ := cmd.Flags().GetBool("verbose")
|
||||
@ -143,7 +143,7 @@ func NewTreePkglistCommand() *cobra.Command {
|
||||
|
||||
if addPkg {
|
||||
plist = append(plist, pkgstr)
|
||||
results.Packages = append(results.Packages, PackageResult{
|
||||
results.Packages = append(results.Packages, TreePackageResult{
|
||||
Name: p.GetName(),
|
||||
Version: p.GetVersion(),
|
||||
Category: p.GetCategory(),
|
||||
|
Loading…
Reference in New Issue
Block a user