(timeout string)
| 86 | } |
| 87 | |
| 88 | func createTimeoutOption(timeout string) (func(c *cmd.Command), error) { |
| 89 | timeoutOpt := cmd.WithoutTimeout |
| 90 | if timeout != "" { |
| 91 | d, err := time.ParseDuration(timeout) |
| 92 | if err != nil { |
| 93 | return func(c *cmd.Command) {}, err |
| 94 | } |
| 95 | timeoutOpt = cmd.WithTimeout(d) |
| 96 | } |
| 97 | |
| 98 | return timeoutOpt, nil |
| 99 | } |