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.
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/synctv-org/synctv/cmd/flags"
|
|
|
|
"github.com/synctv-org/synctv/internal/conf"
|
|
|
|
)
|
|
|
|
|
|
|
|
var RootCmd = &cobra.Command{
|
|
|
|
Use: "synctv-server",
|
|
|
|
Short: "synctv-server",
|
|
|
|
Long: `synctv-server https://github.com/synctv-org/synctv`,
|
|
|
|
}
|
|
|
|
|
|
|
|
func Execute() {
|
|
|
|
if err := RootCmd.Execute(); err != nil {
|
|
|
|
fmt.Fprintln(os.Stderr, err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
RootCmd.PersistentFlags().BoolVar(&flags.Dev, "dev", conf.Version == "dev", "start with dev mode")
|
|
|
|
RootCmd.PersistentFlags().BoolVar(&flags.LogStd, "log-std", true, "log to std")
|
|
|
|
RootCmd.PersistentFlags().BoolVar(&flags.EnvNoPrefix, "env-no-prefix", false, "env no SYNCTV_ prefix")
|
|
|
|
RootCmd.PersistentFlags().BoolVar(&flags.SkipConfig, "skip-config", false, "skip config")
|
|
|
|
RootCmd.PersistentFlags().BoolVar(&flags.SkipEnv, "skip-env", false, "skip env")
|
|
|
|
RootCmd.PersistentFlags().StringVarP(&flags.ConfigFile, "config", "f", "", "config file path")
|
|
|
|
}
|