2020-02-19 16:48:55 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/urfave/cli/v2"
|
2020-02-20 19:09:56 +00:00
|
|
|
"go.jolheiser.com/beaver"
|
2020-02-19 16:48:55 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var List = cli.Command{
|
|
|
|
Name: "list",
|
|
|
|
Aliases: []string{"l"},
|
|
|
|
Usage: "List local packages",
|
|
|
|
Action: doList,
|
|
|
|
}
|
|
|
|
|
2020-10-07 04:11:36 +00:00
|
|
|
func doList(_ *cli.Context) error {
|
2021-02-28 04:20:14 +00:00
|
|
|
pkgs, err := listPackages()
|
2020-10-07 04:11:36 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2021-02-28 04:20:14 +00:00
|
|
|
for _, pkg := range pkgs {
|
|
|
|
beaver.Infof("%s ->\t%s", pkg.Name, pkg.Import)
|
2020-02-19 16:48:55 +00:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|