Returns a single function that calls each argument function in sequence RunE, PreRunE, PersistentPreRunE, etc. all have this same signature
(fs ...cobraCmdFunc)
| 112 | // Returns a single function that calls each argument function in sequence |
| 113 | // RunE, PreRunE, PersistentPreRunE, etc. all have this same signature |
| 114 | func concatCobraCmdFuncs(fs ...cobraCmdFunc) cobraCmdFunc { |
| 115 | return func(cmd *cobra.Command, args []string) error { |
| 116 | for _, f := range fs { |
| 117 | if f != nil { |
| 118 | if err := f(cmd, args); err != nil { |
| 119 | return err |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | return nil |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | // Bind all flags and read the config into viper |
| 128 | func bindFlagsLoadViper(cmd *cobra.Command, args []string) error { |
no outgoing calls
no test coverage detected