# HG changeset patch # User Mikael Berthe # Date 1487509019 -3600 # Node ID 1ec268839876466f3b01aafae6e94680672ba68f # Parent 429d7e612cfd03dc4751d1bc2c40fd1c0cc631d1 Add examples diff -r 429d7e612cfd -r 1ec268839876 gobm65.go --- a/gobm65.go Sun Feb 19 13:40:13 2017 +0100 +++ b/gobm65.go Sun Feb 19 13:56:59 2017 +0100 @@ -1,5 +1,37 @@ +// Copyright (C) 2015-2017 Mikael Berthe . All rights reserved. +// Use of this source code is governed by the MIT license, +// which can be found in the LICENSE file. + +// gobm65 is a Beurer BM65 Blood Pressure Monitor CLI reader. + package main +// Examples: +// +// Get help: +// % gobm65 --help +// +// Get records and display the average: +// % gobm65 --average +// +// Display the latest 3 records with the average: +// % gobm65 -l 3 --average +// Display all records since a specific date: +// % gobm65 --since "2016-06-01" +// Display all records of the last 7 days: +// % gobm65 --since "$(date "+%F" -d "7 days ago")" +// +// Display the last/first 10 records in JSON: +// % gobm65 -l 10 --format json +// +// Save the records to a JSON file: +// % gobm65 -o data_u2.json +// +// Read a JSON file and display average of the last 3 records: +// % gobm65 -i data_u2.json -l 3 --average +// Read a JSON file, merge with device records, and save to another file: +// % gobm65 -i data_u2.json --merge -o data_u2-new.json + import ( "encoding/json" "fmt"