package cmd import ( "fmt" "github.com/spf13/cobra" "os" "os/signal" "syscall" ) var ( rootCmd = &cobra.Command{ Use: "wiretrustee", Short: "", Long: "", } ) // Execute executes the root command. func Execute() error { return rootCmd.Execute() } func init() { rootCmd.AddCommand(upCmd) rootCmd.AddCommand(signalCmd) } func SetupCloseHandler() { c := make(chan os.Signal) signal.Notify(c, os.Interrupt, syscall.SIGTERM) <-c fmt.Println("\r- Ctrl+C pressed in Terminal") os.Exit(0) }