Aesthetic nitpicks on ls timeout

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
Nathan LeClaire 2015-12-10 13:25:13 -08:00
parent a5eb979f09
commit 29ffc04cc9
3 changed files with 10 additions and 8 deletions

View File

@ -220,8 +220,8 @@ var Commands = []cli.Command{
}, },
cli.IntFlag{ cli.IntFlag{
Name: "timeout, t", Name: "timeout, t",
Usage: fmt.Sprintf("Timeout in seconds, default to %ds", DefaultTimeoutDuration), Usage: fmt.Sprintf("Timeout in seconds, default to %s", stateTimeoutDuration),
Value: DefaultTimeoutDuration, Value: lsDefaultTimeout,
}, },
}, },
Name: "ls", Name: "ls",

View File

@ -21,10 +21,10 @@ import (
"github.com/skarademir/naturalsort" "github.com/skarademir/naturalsort"
) )
const DefaultTimeoutDuration = 10 const lsDefaultTimeout = 10
var ( var (
stateTimeoutDuration = DefaultTimeoutDuration * time.Second stateTimeoutDuration = lsDefaultTimeout * time.Second
) )
// FilterOptions - // FilterOptions -
@ -50,7 +50,7 @@ type HostListItem struct {
func cmdLs(c CommandLine, api libmachine.API) error { func cmdLs(c CommandLine, api libmachine.API) error {
stateTimeoutDuration = time.Duration(c.Int("timeout")) * time.Second 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") quiet := c.Bool("quiet")
filters, err := parseFilters(c.StringSlice("filter")) filters, err := parseFilters(c.StringSlice("filter"))

View File

@ -22,9 +22,11 @@ parent="smn_machine_subcmds"
## Timeout ## 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 The `ls` command tries to reach each host in parallel. If a given host does not
will state that this host is in `timeout`. In some circumstances (poor connection, high load or while troubleshooting) you may want to answer in less than 10 seconds, the `ls` command will state that this host is in
increase or decrease this value. You can use the `-t` flag for this purpose with a numerical value in seconds. `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 ### Example