(cmd *cobra.Command)
| 88 | } |
| 89 | |
| 90 | func 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 | |
| 106 | func finishCommandContext() { |
| 107 | if commandContextCancel != nil { |
no outgoing calls
no test coverage detected