gpm/main.go

39 lines
593 B
Go

package main
import (
"os"
"go.jolheiser.com/gpm/cmd"
"go.jolheiser.com/gpm/config"
"github.com/urfave/cli/v2"
"go.jolheiser.com/beaver"
)
func main() {
cfg, err := config.Load()
if err != nil {
beaver.Fatal(err)
}
app := cli.NewApp()
app.Name = "gpm"
app.Usage = "Go Package Manager"
app.Version = config.Version
app.Commands = []*cli.Command{
&cmd.Add,
&cmd.Remove,
&cmd.List,
&cmd.Get,
&cmd.Import,
&cmd.Export,
&cmd.Config,
&cmd.Server,
&cmd.Search,
}
app.Flags = cmd.NewFlags(cfg)
if err := app.Run(os.Args); err != nil {
beaver.Error(err)
}
}