mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-22 13:37:11 +02:00
first commit
This commit is contained in:
commit
0c8af21fab
95 changed files with 5312 additions and 0 deletions
35
server/cmd/root.go
Normal file
35
server/cmd/root.go
Normal file
|
@ -0,0 +1,35 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"n.eko.moe/neko"
|
||||
"n.eko.moe/neko/internal/preflight"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func Execute() error {
|
||||
return root.Execute()
|
||||
}
|
||||
|
||||
var root = &cobra.Command{
|
||||
Use: "neko",
|
||||
Short: "",
|
||||
Long: ``,
|
||||
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 {
|
||||
neko.Service.Logger.Panic().Err(err).Msg("Unable to run command")
|
||||
}
|
||||
|
||||
root.SetVersionTemplate(fmt.Sprintf("Version: %s\n", neko.Service.Version))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue