diff --git a/commands/commands.go b/commands/commands.go index 21cea662bf..acb9956a76 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -220,8 +220,8 @@ var Commands = []cli.Command{ }, cli.IntFlag{ Name: "timeout, t", - Usage: fmt.Sprintf("Timeout in seconds, default to %ds", DefaultTimeoutDuration), - Value: DefaultTimeoutDuration, + Usage: fmt.Sprintf("Timeout in seconds, default to %s", stateTimeoutDuration), + Value: lsDefaultTimeout, }, }, Name: "ls", diff --git a/commands/ls.go b/commands/ls.go index 0030fcc7dc..d9955fb97d 100644 --- a/commands/ls.go +++ b/commands/ls.go @@ -21,10 +21,10 @@ import ( "github.com/skarademir/naturalsort" ) -const DefaultTimeoutDuration = 10 +const lsDefaultTimeout = 10 var ( - stateTimeoutDuration = DefaultTimeoutDuration * time.Second + stateTimeoutDuration = lsDefaultTimeout * time.Second ) // FilterOptions - @@ -50,7 +50,7 @@ type HostListItem struct { func cmdLs(c CommandLine, api libmachine.API) error { stateTimeoutDuration = time.Duration(c.Int("timeout")) * time.Second - log.Debugf("ls timeout set to %d seconds", stateTimeoutDuration/time.Second) + log.Debugf("ls timeout set to %s", stateTimeoutDuration) quiet := c.Bool("quiet") filters, err := parseFilters(c.StringSlice("filter")) diff --git a/docs/reference/ls.md b/docs/reference/ls.md index e8cf87dfdf..1b2a60e58c 100644 --- a/docs/reference/ls.md +++ b/docs/reference/ls.md @@ -22,9 +22,11 @@ parent="smn_machine_subcmds" ## Timeout -The `ls` command tries to reach each host in parallel. If a given host does not answer in less than 10 seconds, the `ls` command -will state that this host is in `timeout`. In some circumstances (poor connection, high load or while troubleshooting) you may want to -increase or decrease this value. You can use the `-t` flag for this purpose with a numerical value in seconds. +The `ls` command tries to reach each host in parallel. If a given host does not +answer in less than 10 seconds, the `ls` command will state that this host is in +`Timeout` state. In some circumstances (poor connection, high load, or while +troubleshooting), you may want to increase or decrease this value. You can use +the -t flag for this purpose with a numerical value in seconds. ### Example