You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
synctv/cmd/conf.go

29 lines
583 B
Go

package cmd
import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/synctv-org/synctv/internal/bootstrap"
)
var ConfCmd = &cobra.Command{
Use: "conf",
Short: "init or check",
Long: `Init or check config file for correctness`,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
return bootstrap.New(bootstrap.WithContext(cmd.Context())).Add(
bootstrap.InitConfig,
).Run()
},
RunE: Conf,
}
func Conf(cmd *cobra.Command, args []string) error {
logrus.Infof("success")
return nil
}
func init() {
RootCmd.AddCommand(ConfCmd)
}