MCPcopy Create free account
hub / github.com/dropbox/dbxcli / commandTimeout

Function commandTimeout

cmd/root.go:90–104  ·  view source on GitHub ↗
(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

88}
89
90func commandTimeout(cmd *cobra.Command) (time.Duration, error) {
91 for _, flags := range []interface {
92 Lookup(string) *pflag.Flag
93 GetDuration(string) (time.Duration, error)
94 }{
95 cmd.Flags(),
96 cmd.InheritedFlags(),
97 cmd.PersistentFlags(),
98 } {
99 if flags.Lookup("timeout") != nil {
100 return flags.GetDuration("timeout")
101 }
102 }
103 return 0, nil
104}
105
106func finishCommandContext() {
107 if commandContextCancel != nil {

Callers 1

initCommandContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected