diff --git a/cmd/signaldctl/cmd/root.go b/cmd/signaldctl/cmd/root.go index 4f75fa8..e6e5c36 100644 --- a/cmd/signaldctl/cmd/root.go +++ b/cmd/signaldctl/cmd/root.go @@ -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)