Merge pull request #2552 from nathanleclaire/ls_timeout_nits

Aesthetic nitpicks on ls timeout
This commit is contained in:
Jean-Laurent de Morlhon 2015-12-11 10:55:40 +01:00
commit 02dde087c9
3 changed files with 10 additions and 8 deletions

View File

@ -223,8 +223,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",

View File

@ -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"))

View File

@ -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