mu/options: Support date sortfield

Fixes #2368.
This commit is contained in:
Dirk-Jan C. Binnema 2022-11-22 23:16:37 +02:00
parent d2a3a13242
commit 4d1352ec56
2 changed files with 19 additions and 17 deletions

View File

@ -159,6 +159,8 @@ struct Field {
constexpr bool is_searchable() const { return is_indexable_term() ||
is_boolean_term() ||
is_normal_term(); }
constexpr bool is_sortable() const { return is_value(); }
constexpr bool is_value() const { return any_of(Flag::Value); }
constexpr bool is_internal() const { return any_of(Flag::Internal); }

View File

@ -309,7 +309,7 @@ sub_find(CLI::App& sub, Options& opts)
std::unordered_map<std::string, Field::Id> smap;
std::string sopts;
field_for_each([&](auto&& field){
if (field.is_searchable()) {
if (field.is_sortable()) {
smap.emplace(std::string(field.name), field.id);
if (!sopts.empty())
sopts += ", ";