25 lines
394 B
Go
25 lines
394 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/urfave/cli/v2"
|
|
"go.jolheiser.com/beaver"
|
|
)
|
|
|
|
var List = cli.Command{
|
|
Name: "list",
|
|
Aliases: []string{"l"},
|
|
Usage: "List local packages",
|
|
Action: doList,
|
|
}
|
|
|
|
func doList(_ *cli.Context) error {
|
|
pkgs, err := listPackages()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
for _, pkg := range pkgs {
|
|
beaver.Infof("%s ->\t%s", pkg.Name, pkg.Import)
|
|
}
|
|
return nil
|
|
}
|