parent
2220ab17eb
commit
e0817ea38c
11
cmd/list.go
11
cmd/list.go
|
@ -1,8 +1,11 @@
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"text/tabwriter"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"go.jolheiser.com/beaver"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var List = cli.Command{
|
var List = cli.Command{
|
||||||
|
@ -17,8 +20,10 @@ func doList(_ *cli.Context) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
|
||||||
for _, pkg := range pkgs {
|
for _, pkg := range pkgs {
|
||||||
beaver.Infof("%s ->\t%s", pkg.Name, pkg.Import)
|
s := fmt.Sprintf("%s\t%s\n", pkg.Name, pkg.Import)
|
||||||
|
_, _ = w.Write([]byte(s))
|
||||||
}
|
}
|
||||||
return nil
|
return w.Flush()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue