(cmd *cobra.Command)
| 206 | } |
| 207 | |
| 208 | func getCommandFlags(cmd *cobra.Command) map[string]string { |
| 209 | flags := make(map[string]string) |
| 210 | cmd.Flags().Visit(func(f *pflag.Flag) { |
| 211 | var fValue string |
| 212 | if f.Value.Type() == "bool" { |
| 213 | fValue = f.Value.String() |
| 214 | } |
| 215 | flags[f.Name] = fValue |
| 216 | }) |
| 217 | return flags |
| 218 | } |
| 219 | |
| 220 | // getNaiveFlags string-matches argv and parses them into a map. |
| 221 | // This is used when calling hooks after a plugin command, since |
no test coverage detected
searching dependent graphs…