36 lines
651 B
Go
36 lines
651 B
Go
|
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{
|
||
|
cmd.Branch,
|
||
|
},
|
||
|
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("")
|
||
|
}
|
||
|
}
|