Files
umbrix-libcore/cmd/cmd_run.go

29 lines
644 B
Go
Raw Normal View History

package cmd
2024-01-29 21:55:01 +01:00
import (
2024-03-22 16:25:56 +00:00
v2 "github.com/hiddify/hiddify-core/v2"
2024-01-29 21:55:01 +01:00
"github.com/spf13/cobra"
)
var commandRun = &cobra.Command{
Use: "run",
Short: "run",
Args: cobra.OnlyValidArgs,
Run: runCommand,
2024-01-29 21:55:01 +01:00
}
func init() {
// commandRun.PersistentFlags().BoolP("help", "", false, "help for this command")
// commandRun.Flags().StringVarP(&hiddifySettingPath, "hiddify", "d", "", "Hiddify Setting JSON Path")
2024-05-29 18:47:04 +02:00
addHConfigFlags(commandRun)
2024-02-02 13:47:41 +01:00
mainCommand.AddCommand(commandRun)
}
2024-02-02 13:47:41 +01:00
func runCommand(cmd *cobra.Command, args []string) {
2024-09-29 22:58:36 +02:00
v2.Setup("./tmp", "./", "./tmp", 0, false)
2024-05-29 18:47:04 +02:00
v2.RunStandalone(hiddifySettingPath, configPath, defaultConfigs)
2024-01-29 21:55:01 +01:00
}