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`). 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. 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) { 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( 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)