Merge branch 'develop' into main
continuous-integration/drone/push Build is passing Details

This commit is contained in:
tastytea 2019-09-23 21:56:40 +02:00
commit a414b998f0
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
5 changed files with 29 additions and 23 deletions

View File

@ -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`).

View File

@ -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.

View File

@ -86,6 +86,7 @@ int App::main(const std::vector<std::string> &args)
cerr << page.error << endl;
return 3;
}
archive_answer archive;
if (_archive)
{

View File

@ -52,7 +52,7 @@ void App::defineOptions(OptionSet& options)
.argument("tags")
.callback(OptionCallback<App>(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<App>(this, &App::handle_options)));
options.addOption(

View File

@ -183,25 +183,27 @@ namespace remwharead
_out << "== Tags\n\n";
vector<tagpair> 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<char> &coll =
std::use_facet<std::collate<char>>(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<char> &coll =
std::use_facet<std::collate<char>>(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)