diff --git a/cmd/cdrtool/main.go b/cmd/cdrtool/main.go index 5528bfd..ce91256 100644 --- a/cmd/cdrtool/main.go +++ b/cmd/cdrtool/main.go @@ -13,6 +13,8 @@ var ( csvFile = flag.String("csv", "", "use this call detail record CSV file") validate = flag.Bool("validate", false, "only validate the call detail record CSV, perform no other actions") pricesFile = flag.String("prices", "", "use this pricing CSV file") + priceExec = flag.Bool("execute", false, "price each CDR according to the prices file") + debug = flag.Bool("debug", false, "show extra debugging") ) func usage() { @@ -58,11 +60,17 @@ func main() { log.Fatalf("importing CSV failed: %v", err) } - for _, i := range imported { - fmt.Printf("l: %+v\n", i) + if *debug { + for _, i := range imported { + fmt.Printf("l: %+v\n", i) + } + + for _, i := range importedPrices { + fmt.Printf("p: %+v\n", i) + } } - for _, i := range importedPrices { - fmt.Printf("p: %+v\n", i) + if *priceExec { + } } diff --git a/import.go b/import_cdr.go similarity index 100% rename from import.go rename to import_cdr.go diff --git a/pricing.go b/import_price.go similarity index 97% rename from pricing.go rename to import_price.go index 54869cf..65a507f 100644 --- a/pricing.go +++ b/import_price.go @@ -88,7 +88,7 @@ func ImportPricesFile(fn string) ([]Price, error) { "Mobile", } for _, line := range all { - if line[PriceImportRegion] == "Regio" || line[PriceImportDestination] == "" { + if line[PriceImportRegion] == "Regio" || line[PriceImportDestination] == "" { // Header line or no destination continue }