Archived
2
0
This repository has been archived on 2024-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
neko-custom/server/cmd/root.go
2020-01-18 23:30:09 +00:00

37 lines
672 B
Go

package cmd
import (
"fmt"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"n.eko.moe/neko"
"n.eko.moe/neko/internal/preflight"
)
func Execute() error {
return root.Execute()
}
var root = &cobra.Command{
Use: "neko",
Short: "neko streaming server",
Long: `neko streaming server`,
Version: neko.Service.Version.String(),
}
func init() {
cobra.OnInitialize(func() {
preflight.Logs("neko")
preflight.Config("neko")
neko.Service.Root.Set()
})
if err := neko.Service.Root.Init(root); err != nil {
log.Panic().Err(err).Msg("unable to run root command")
}
root.SetVersionTemplate(fmt.Sprintf("version: %s\n", neko.Service.Version))
}