Add option --until default tip
authorMikael Berthe <mikael@lilotux.net>
Sat, 10 Jul 2021 22:15:47 +0200
changeset 30 0df0950f4c21
parent 29 2b8506d91ad5
Add option --until We have --since (alias for --from-date), let's have --until for --to-date...
gobm65.go
--- a/gobm65.go	Sat Jul 10 20:57:45 2021 +0200
+++ b/gobm65.go	Sat Jul 10 22:15:47 2021 +0200
@@ -31,9 +31,11 @@
 // Display the latest 3 records with the average:
 // % gobm65 -l 3 --average
 // Display all records since a specific date:
+// % gobm65 --from-date "2016-06-01"
 // % gobm65 --since "2016-06-01"
 // Display all records before a specific date:
 // % gobm65 --to-date "2016-06-30"
+// % gobm65 --until "2016-06-30"
 // Display all records of the last 7 days:
 // % gobm65 --since "$(date "+%F" -d "7 days ago")"
 //
@@ -583,6 +585,7 @@
 	reduce := flag.BoolP("reduce", "r", false, "Reduce number of measurements (regroup measurements)")
 
 	flag.StringVar(fromDate, "since", "", "Same as --from-date")
+	flag.StringVar(toDate, "until", "", "Same as --to-date")
 
 	var startTime, endTime simpleTime