Change option names for consistency
authorMikael Berthe <mikael@lilotux.net>
Sun, 26 Feb 2017 17:06:21 +0100
changeset 18 f6646f63b11a
parent 17 d83a4f6556e4
child 19 afbb4d9ae536
Change option names for consistency
gobm65.go
--- a/gobm65.go	Sun Feb 26 15:49:10 2017 +0100
+++ b/gobm65.go	Sun Feb 26 17:06:21 2017 +0100
@@ -28,7 +28,7 @@
 // Display all records since a specific date:
 // % gobm65 --since "2016-06-01"
 // Display all records before a specific date:
-// % gobm65 --before "2016-06-30"
+// % gobm65 --to-date "2016-06-30"
 // Display all records of the last 7 days:
 // % gobm65 --since "$(date "+%F" -d "7 days ago")"
 //
@@ -399,9 +399,9 @@
 	inFile := flag.String([]string{"-input-file", "i"}, "", "Input JSON file")
 	outFile := flag.String([]string{"-output-file", "o"}, "", "Output JSON file")
 	limit := flag.Uint([]string{"-limit", "l"}, 0, "Limit number of items to N first")
-	before := flag.String([]string{"-before"}, "",
+	toDate := flag.String([]string{"-to-date"}, "",
 		"Filter records before date (YYYY-mm-dd HH:MM:SS)")
-	since := flag.String([]string{"-since", "-after"}, "",
+	fromDate := flag.String([]string{"-from-date", "-since"}, "",
 		"Filter records from date (YYYY-mm-dd HH:MM:SS)")
 	format := flag.String([]string{"-format", "f"}, "", "Output format (csv, json)")
 	avg := flag.Bool([]string{"-average", "a"}, false, "Compute average")
@@ -443,12 +443,12 @@
 		}
 	}
 
-	startDate, err := parseDate(*since)
+	startDate, err := parseDate(*fromDate)
 	if err != nil {
 		log.Fatal("Could not parse date: ", err)
 	}
 
-	endDate, err := parseDate(*before)
+	endDate, err := parseDate(*toDate)
 	if err != nil {
 		log.Fatal("Could not parse date: ", err)
 	}