diff --git a/cmd/signald-cli/cmd/root.go b/cmd/signald-cli/cmd/root.go index de24eb8..a943e55 100644 --- a/cmd/signald-cli/cmd/root.go +++ b/cmd/signald-cli/cmd/root.go @@ -17,6 +17,7 @@ package cmd import ( "fmt" + "log" "os" "github.com/spf13/cobra" @@ -50,7 +51,11 @@ func init() { RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.signald-cli.yaml)") RootCmd.PersistentFlags().StringVarP(&socketPath, "socket", "s", "/var/run/signald/signald.sock", "the path to the signald socket file") s = &signald.Signald{SocketPath: socketPath} - s.Connect() + err := s.Connect() + if err != nil { + log.Fatal(err) + } + } // initConfig reads in config file and ENV variables if set.