Merge branch 'fix_socket_path' into 'main'
issue #9: Fix SocketPath handling See merge request signald/signald-go!3
This commit is contained in:
commit
d44f76e716
1 changed files with 3 additions and 1 deletions
|
@ -69,11 +69,13 @@ func Execute() {
|
|||
func init() {
|
||||
cobra.OnInitialize(initConfig)
|
||||
defaultConfigPath := fmt.Sprintf("%s/.config/signaldctl.yaml", os.Getenv("HOME"))
|
||||
defaultSocketPath := ""
|
||||
if os.Getenv("SIGNALDCTL_PUBLIC_DOC_MODE") == "on" {
|
||||
defaultConfigPath = "~/.config/signaldctl.yaml"
|
||||
defaultSocketPath = "/var/run/signald/signald.sock"
|
||||
}
|
||||
RootCmd.PersistentFlags().StringVar(&config.Path, "config", defaultConfigPath, "config file")
|
||||
RootCmd.PersistentFlags().StringVar(&socketPath, "socket", "/var/run/signald/signald.sock", "the path to the signald socket file")
|
||||
RootCmd.PersistentFlags().StringVar(&socketPath, "socket", defaultSocketPath, "the path to the signald socket file")
|
||||
RootCmd.PersistentFlags().StringVarP(&common.OutputFormat, "output-format", "o", "default", "the output format. options are usually table, yaml and json, default is usually table. Some commands have other options.")
|
||||
RootCmd.AddCommand(account.AccountCmd)
|
||||
RootCmd.AddCommand(configcmd.ConfigCmd)
|
||||
|
|
Loading…
Reference in a new issue