2020-02-19 05:18:36 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2020-10-07 04:11:36 +00:00
|
|
|
"os"
|
|
|
|
|
|
|
|
"go.jolheiser.com/gpm/cmd"
|
|
|
|
"go.jolheiser.com/gpm/config"
|
|
|
|
|
2020-02-19 05:18:36 +00:00
|
|
|
"github.com/urfave/cli/v2"
|
2020-02-20 19:09:56 +00:00
|
|
|
"go.jolheiser.com/beaver"
|
2020-02-19 05:18:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2020-10-07 04:11:36 +00:00
|
|
|
cfg, err := config.Load()
|
|
|
|
if err != nil {
|
|
|
|
beaver.Fatal(err)
|
|
|
|
}
|
2020-02-19 05:18:36 +00:00
|
|
|
|
|
|
|
app := cli.NewApp()
|
|
|
|
app.Name = "gpm"
|
|
|
|
app.Usage = "Go Package Manager"
|
2020-02-20 05:46:44 +00:00
|
|
|
app.Version = config.Version
|
2020-02-19 05:18:36 +00:00
|
|
|
app.Commands = []*cli.Command{
|
|
|
|
&cmd.Add,
|
|
|
|
&cmd.Remove,
|
2020-02-19 16:48:55 +00:00
|
|
|
&cmd.List,
|
2020-02-19 05:18:36 +00:00
|
|
|
&cmd.Get,
|
2020-02-19 16:48:55 +00:00
|
|
|
&cmd.Import,
|
2020-02-19 05:18:36 +00:00
|
|
|
&cmd.Export,
|
2020-02-19 05:39:54 +00:00
|
|
|
&cmd.Config,
|
2020-02-20 05:46:44 +00:00
|
|
|
&cmd.Server,
|
2020-10-07 04:11:36 +00:00
|
|
|
&cmd.Search,
|
2020-02-19 05:18:36 +00:00
|
|
|
}
|
2020-10-07 04:11:36 +00:00
|
|
|
app.Flags = cmd.NewFlags(cfg)
|
|
|
|
if err := app.Run(os.Args); err != nil {
|
2020-02-19 05:18:36 +00:00
|
|
|
beaver.Error(err)
|
|
|
|
}
|
|
|
|
}
|