From 0cf8c65c4088a5a5f11c9a81d48d6138ae7e63cc Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 16 May 2019 12:55:54 +0200 Subject: [PATCH] Removed --sort. --- remwharead.1.adoc | 3 --- src/parse_options.cpp | 24 ------------------------ src/parse_options.hpp | 1 - src/types.hpp | 7 ------- 4 files changed, 35 deletions(-) diff --git a/remwharead.1.adoc b/remwharead.1.adoc index 48c3d9f..aa3963a 100644 --- a/remwharead.1.adoc +++ b/remwharead.1.adoc @@ -40,9 +40,6 @@ are date and time representations according to ISO 8601 (YYYY-MM-DDThh:mm:ss). Time zones are ignored. Example: `--span 2019-01-01,2019-02-10T12:30`. -*-S* _attribute_, *--sort* _attribute_:: -Sort by _time_, _tag_ or _both_ (default) when exporting to _asciidoc_. - *-h*, *--help*:: Show help message. diff --git a/src/parse_options.cpp b/src/parse_options.cpp index 6b59076..2665b74 100644 --- a/src/parse_options.cpp +++ b/src/parse_options.cpp @@ -37,7 +37,6 @@ const options parse_options(const int argc, const char *argv[]) string format; string file; string span; - string sort; options opts; try @@ -52,8 +51,6 @@ const options parse_options(const int argc, const char *argv[]) op.add> ("s", "span", "Only export entries between YYYY-MM-DD,YYYY-MM-DD.", "", &span); - op.add> - ("S", "sort", "Sort by time, tag or both (default).", "", &sort); auto option_help = op.add ("h", "help", "Show this help message."); auto option_version = op.add @@ -132,27 +129,6 @@ const options parse_options(const int argc, const char *argv[]) } } - if (!sort.empty()) - { - if (sort == "time") - { - opts.sort = sort_attribute::time; - } - else if (sort == "tag") - { - opts.sort = sort_attribute::tag; - } - else if (sort == "both") - { - opts.sort = sort_attribute::both; - } - else - { - cerr << "Error: --sort " << sort << " not understood.\n"; - return options(1); - } - } - if (op.non_option_args().size() > 0) { opts.uri = op.non_option_args().front(); diff --git a/src/parse_options.hpp b/src/parse_options.hpp index 716d7fc..d3ae869 100644 --- a/src/parse_options.hpp +++ b/src/parse_options.hpp @@ -38,7 +38,6 @@ typedef struct options export_format format = export_format::undefined; string file; array span = { time_point(), system_clock::now() }; - sort_attribute sort = sort_attribute::both; string uri; uint8_t status_code = 0; diff --git a/src/types.hpp b/src/types.hpp index 486cec9..7c3203e 100644 --- a/src/types.hpp +++ b/src/types.hpp @@ -24,11 +24,4 @@ enum class export_format asciidoc }; -enum class sort_attribute -{ - both, - time, - tag -}; - #endif // REMWHAREAD_TYPES_HPP