diff --git a/remwharead.1.adoc b/remwharead.1.adoc index 43afa0d..a661fd4 100644 --- a/remwharead.1.adoc +++ b/remwharead.1.adoc @@ -2,7 +2,7 @@ :doctype: manpage :Author: tastytea :Email: tastytea@tastytea.de -:Date: 2019-05-14 +:Date: 2019-05-16 :Revision: 0.0.0 :man source: remwharead :man manual: General Commands Manual @@ -35,9 +35,9 @@ Export to _format_. Possible values are _csv_ and _asciidoc_. Save output to _file_. Default is stdout. *-s* _start_,_end_, *--span* _start_,_end_:: -Only export entries between _start_ and _end_. _start_ and _end_ are date and -time representations according to ISO 8601. Time zones are ignored at the -moment. +Only export entries between and including _start_ and _end_. _start_ and _end_ +are date and time representations according to ISO 8601. Time zones are ignored +at the moment. Example: `--span 2019-01-01,2019-02-10T12:30`. *-S* _attribute_, *--sort* _attribute_:: Sort by _time_, _tag_ or _both_ (default) when exporting to _asciidoc_. diff --git a/src/main.cpp b/src/main.cpp index 58fc402..dd0aa8d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -55,7 +55,8 @@ int main(const int argc, const char *argv[]) { case export_format::csv: { - for (const Database::entry &entry : db.retrieve()) + for (const Database::entry &entry + : db.retrieve(opts.span[0], opts.span[1])) { string strtags; for (const string &tag : entry.tags) @@ -75,7 +76,7 @@ int main(const int argc, const char *argv[]) } case export_format::asciidoc: { - cerr << "AsciiDoc is not yet supported.\n"; + cerr << "Error: AsciiDoc is not yet supported.\n"; break; } default: diff --git a/src/parse_options.hpp b/src/parse_options.hpp index 8cbf8f0..add8160 100644 --- a/src/parse_options.hpp +++ b/src/parse_options.hpp @@ -37,7 +37,7 @@ typedef struct options vector tags; export_format format = export_format::undefined; string file; - array span; + array span = { time_point(), system_clock::now() }; sort_attribute sort = sort_attribute::both; string url; uint8_t status_code = 0;