From 4e5827976779e800f77377b429d9373a56c3e081 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 23 Sep 2019 03:16:32 +0200 Subject: [PATCH 1/5] Fixed hyperlink to bookmarks spec in manpage. --- man/remwharead.1.adoc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/man/remwharead.1.adoc b/man/remwharead.1.adoc index 63419f7..95428f9 100644 --- a/man/remwharead.1.adoc +++ b/man/remwharead.1.adoc @@ -2,7 +2,7 @@ :doctype: manpage :Author: tastytea :Email: tastytea@tastytea.de -:Date: 2019-09-21 +:Date: 2019-09-23 :Revision: 0.0.0 :man source: remwharead :man manual: General Commands Manual @@ -129,8 +129,7 @@ HTML, PDF and many other formats. === bookmarks -The -https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa753582(v=vs.85)[Netscape +The https://msdn.microsoft.com/en-us/library/aa753582(VS.85).aspx[Netscape Bookmark file format] is a format for exporting and importing bookmarks that is understood by most browsers. From c484800f6dfe274b0426ce1735961dda4b33e982 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 23 Sep 2019 03:16:58 +0200 Subject: [PATCH 2/5] Improved short help for --export. --- src/cli/parse_options.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/parse_options.cpp b/src/cli/parse_options.cpp index fcab7a6..a708485 100644 --- a/src/cli/parse_options.cpp +++ b/src/cli/parse_options.cpp @@ -52,7 +52,7 @@ void App::defineOptions(OptionSet& options) .argument("tags") .callback(OptionCallback(this, &App::handle_options))); options.addOption( - Option("export", "e", "Export to format.") + Option("export", "e", "Export to format. See manpage for a list.") .argument("format") .callback(OptionCallback(this, &App::handle_options))); options.addOption( From 8584ac2dfe625f6ecc75d5e994bd3a7a8b1eef98 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 23 Sep 2019 19:25:52 +0200 Subject: [PATCH 3/5] =?UTF-8?q?Add=20=E2=80=9Cpatch=20via=20email=E2=80=9D?= =?UTF-8?q?-paragraph=20to=20contributing=20guidelines.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index b3ecd7e..d075d5a 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -1,4 +1,5 @@ :project: remwharead +:patch_contact: tastytea@tastytea.de == How to contribute @@ -20,3 +21,6 @@ account. Please use similar coding conventions as the rest of the project. The basic rule to remember is to write code in the same style as the existing/surrounding code. + +You can also send me your patches via email, to {patch_contact} (ideally using +`git format-patch` or `git send-email`). From b4fb62b15acf3518f2aa0192f8dca7fc3d9cc026 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 23 Sep 2019 19:28:19 +0200 Subject: [PATCH 4/5] Add readability-newline. --- src/cli/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cli/main.cpp b/src/cli/main.cpp index 1d155e6..1103b9f 100644 --- a/src/cli/main.cpp +++ b/src/cli/main.cpp @@ -86,6 +86,7 @@ int App::main(const std::vector &args) cerr << page.error << endl; return 3; } + archive_answer archive; if (_archive) { From da88eaf7034e9f5f8d87b1d9ee864588ed52f69e Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 23 Sep 2019 21:52:10 +0200 Subject: [PATCH 5/5] Moved tagpair-lambda up for better readability. --- src/lib/export/adoc.cpp | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/lib/export/adoc.cpp b/src/lib/export/adoc.cpp index 43f7178..51abfff 100644 --- a/src/lib/export/adoc.cpp +++ b/src/lib/export/adoc.cpp @@ -183,25 +183,27 @@ namespace remwharead _out << "== Tags\n\n"; vector sortedtags(tags.size()); std::move(tags.begin(), tags.end(), sortedtags.begin()); - std::sort(sortedtags.begin(), sortedtags.end(), - [](const tagpair &a, tagpair &b) - { - if (a.second.size() != b.second.size()) - { // Sort by number of occurrences if they are different. - return a.second.size() > b.second.size(); - } - else - { // Sort by tag names otherwise. - std::locale loc; - const std::collate &coll = - std::use_facet>(loc); - return (coll.compare( - a.first.data(), a.first.data() - + a.first.length(), - b.first.data(), b.first.data() - + b.first.length()) == -1); - } - }); + + const auto compare_tags = + [](const tagpair &a, tagpair &b) + { + if (a.second.size() != b.second.size()) + { // Sort by number of occurrences if they are different. + return a.second.size() > b.second.size(); + } + else + { // Sort by tag names otherwise. + const std::locale loc; + const std::collate &coll = + std::use_facet>(loc); + return ( + coll.compare( + a.first.data(), a.first.data() + a.first.length(), + b.first.data(), b.first.data() + b.first.length()) + == -1); + } + }; + std::sort(sortedtags.begin(), sortedtags.end(), compare_tags); bool othertags = false; // Have we printed “Less used tags” already? for (const auto &tag : sortedtags)