(cmd *cobra.Command, args []string)
| 46 | } |
| 47 | |
| 48 | func runMetadataStats(cmd *cobra.Command, args []string) error { |
| 49 | meta, err := api.LoadMetadataFromFile() |
| 50 | if err != nil { |
| 51 | return err |
| 52 | } |
| 53 | |
| 54 | fmt.Printf("Products: %d\n", len(meta.ProductRegions)) |
| 55 | fmt.Printf("Attr groups: %d\n", len(meta.ProductAttrs)) |
| 56 | |
| 57 | totalRegions := map[string]struct{}{} |
| 58 | for _, regs := range meta.ProductRegions { |
| 59 | for _, r := range regs { |
| 60 | if r != "" { |
| 61 | totalRegions[r] = struct{}{} |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | fmt.Printf("Regions: %d\n", len(totalRegions)) |
| 66 | return nil |
| 67 | } |
nothing calls this directly
no test coverage detected