blasphem/cmd/blas/main.go

34 lines
600 B
Go

package main
import (
"os"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"dynatron.me/x/blasphem/internal/common"
"dynatron.me/x/blasphem/pkg/cmd/serve"
"dynatron.me/x/blasphem/pkg/config"
"github.com/spf13/cobra"
)
func main() {
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
rootCmd := cobra.Command{
Use: common.AppName,
}
config, err := config.ReadConfig()
if err != nil {
log.Fatal().Err(err).Msg("Config read failed")
}
rootCmd.AddCommand(serve.Command(config))
err = rootCmd.Execute()
if err != nil {
log.Fatal().Err(err).Msg("Dying")
}
}