MCPcopy Create free account
hub / github.com/commander-cli/commander / createTimeoutOption

Function createTimeoutOption

pkg/runtime/local_executor.go:88–99  ·  view source on GitHub ↗
(timeout string)

Source from the content-addressed store, hash-verified

86}
87
88func 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}

Callers 1

ExecuteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected