Skip to content

Commit

Permalink
Add ip flag to daemon command (#1651)
Browse files Browse the repository at this point in the history
  • Loading branch information
silvanocerza committed Feb 3, 2022
1 parent 47c634b commit 200d4b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cli/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import (

var (
tr = i18n.Tr
ip string
daemonize bool
debug bool
debugFilters []string
Expand All @@ -59,6 +60,7 @@ func NewCommand() *cobra.Command {
Args: cobra.NoArgs,
Run: runDaemonCommand,
}
daemonCommand.PersistentFlags().StringVar(&ip, "ip", "127.0.0.1", tr("The IP address the daemon will listen to"))
daemonCommand.PersistentFlags().String("port", "", tr("The TCP port the daemon will listen to"))
configuration.Settings.BindPFlag("daemon.port", daemonCommand.PersistentFlags().Lookup("port"))
daemonCommand.Flags().BoolVar(&daemonize, "daemonize", false, tr("Do not terminate daemon process if the parent process dies"))
Expand Down Expand Up @@ -112,7 +114,6 @@ func runDaemonCommand(cmd *cobra.Command, args []string) {
}()
}

ip := "127.0.0.1"
lis, err := net.Listen("tcp", fmt.Sprintf("%s:%s", ip, port))
if err != nil {
// Invalid port, such as "Foo"
Expand Down

0 comments on commit 200d4b4

Please sign in to comment.