mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
37 lines
672 B
Go
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))
|
|
}
|