chore: run cmd

This commit is contained in:
braginini 2021-04-14 14:27:59 +02:00
parent 6b3ba0feaf
commit a820d83a39

View File

@ -5,7 +5,6 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/wiretrustee/wiretrustee/signal" "github.com/wiretrustee/wiretrustee/signal"
"github.com/wiretrustee/wiretrustee/signal/proto"
"os" "os"
) )
@ -13,6 +12,13 @@ const (
ExitSetupFailed = 1 ExitSetupFailed = 1
) )
var (
opts struct {
config string
logLevel string
}
)
func init() { func init() {
runCmd := &cobra.Command{ runCmd := &cobra.Command{
Use: "start", Use: "start",
@ -41,7 +47,9 @@ func init() {
select {} select {}
}, },
} }
rootCmd.AddCommand(runCmd)
// todo generate config if doesn't exist
runCmd.PersistentFlags().StringVar(&opts.config, "config", "", "--config <config file path>")
} }
func ReadConfig(path string) (*Config, error) { func ReadConfig(path string) (*Config, error) {