2022-08-23 17:04:13 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"go.jolheiser.com/git-ea/cmd"
|
|
|
|
|
|
|
|
"github.com/peterbourgon/ff/v3/ffcli"
|
|
|
|
"github.com/rs/zerolog"
|
|
|
|
"github.com/rs/zerolog/log"
|
|
|
|
)
|
|
|
|
|
|
|
|
var Version = "x.y.z"
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
|
|
|
|
|
|
|
|
c := &ffcli.Command{
|
|
|
|
Name: "ea",
|
|
|
|
ShortUsage: "ea <cmd>",
|
|
|
|
ShortHelp: "ea is the base command",
|
|
|
|
Subcommands: []*ffcli.Command{
|
2022-08-23 19:38:41 +00:00
|
|
|
cmd.Backport,
|
2022-08-23 17:04:13 +00:00
|
|
|
cmd.Branch,
|
2022-08-23 19:38:41 +00:00
|
|
|
cmd.Frontport,
|
2022-08-23 17:04:13 +00:00
|
|
|
},
|
|
|
|
Exec: func(_ context.Context, _ []string) error {
|
|
|
|
log.Info().Msgf("git-ea v%s", Version)
|
|
|
|
return nil
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := c.ParseAndRun(context.Background(), os.Args[1:]); err != nil {
|
|
|
|
log.Err(err).Msg("")
|
|
|
|
}
|
|
|
|
}
|