mu-info: add 'topic mu' information; improve manpage

Show some more runtime information in the 'mu' topic, and make that the
default. Update manpage.
This commit is contained in:
Dirk-Jan C. Binnema 2023-07-26 19:09:18 +03:00
parent 3aecaca9b9
commit 30b0209f8d
2 changed files with 28 additions and 24 deletions

View File

@ -13,13 +13,12 @@
~mu info~ is the ~mu~ command for getting information about various topics: ~mu info~ is the ~mu~ command for getting information about various topics:
- *common*: general mu build information - *mu*: general mu build information (default)
- *store*: information about the message store - *store*: information about the message store
- *fields*: table with all the query fields and flags - *fields*: table with all the query fields and flags
about the mu database. Note Note that while running (e.g. ~mu4e~), some of the ~store~ information can be
that while running (e.g. ~mu4e~), some of the information may be slightly delayed delayed due to database caching.
due to database caching.
#+include: "common-options.inc" :minlevel 1 #+include: "common-options.inc" :minlevel 1

View File

@ -21,6 +21,7 @@
#include "mu-cmd.hh" #include "mu-cmd.hh"
#include <message/mu-message.hh> #include <message/mu-message.hh>
#include <xapian.h>
#include "utils/mu-utils.hh" #include "utils/mu-utils.hh"
#include <fmt/ostream.h> #include <fmt/ostream.h>
@ -85,7 +86,6 @@ colorify(Table& table, const Options& opts)
table[0][c].format() table[0][c].format()
.font_color(Color::white) .font_color(Color::white)
.font_style({FontStyle::bold}); .font_style({FontStyle::bold});
} }
@ -220,23 +220,13 @@ topic_mu(const Options& opts)
using namespace tabulate; using namespace tabulate;
info.add_row({"property", "value"}); info.add_row({"property", "value", "description"});
info.add_row({"version", std::string{VERSION}}); info.add_row({"mu-version", std::string{VERSION},
info.add_row({"schema-version", mu_format("{}", MU_STORE_SCHEMA_VERSION)}); "Mu runtime version"});
info.add_row({"guile-support", info.add_row({"xapian-version", Xapian::version_string(),
#if BUILD_GUILE "Xapian runtime version"});
"yes" info.add_row({"schema-version", mu_format("{}", MU_STORE_SCHEMA_VERSION),
#else "Version of the database schema"});
"no"
#endif
});
info.add_row({"readline-support",
#if HAVE_LIBREADLINE
"yes"
#else
"no"
#endif
});
info.add_row({"cld2-support", info.add_row({"cld2-support",
#if HAVE_CLD2 #if HAVE_CLD2
@ -244,7 +234,22 @@ topic_mu(const Options& opts)
#else #else
"no" "no"
#endif #endif
}); , "Support searching by language-code?"});
info.add_row({"guile-support",
#if BUILD_GUILE
"yes"
#else
"no"
#endif
, "GNU Guile 3.x scripting support?"});
info.add_row({"readline-support",
#if HAVE_LIBREADLINE
"yes"
#else
"no"
#endif
, "Better 'm server' REPL for debugging?"});
if (!opts.nocolor) if (!opts.nocolor)
colorify(info, opts); colorify(info, opts);
@ -271,7 +276,7 @@ Mu::mu_cmd_info(const Mu::Store& store, const Options& opts)
} else if (topic == "mu") { } else if (topic == "mu") {
return topic_mu(opts); return topic_mu(opts);
} else { } else {
topic_store(store, opts); topic_mu(opts);
MaybeAnsi col{!opts.nocolor}; MaybeAnsi col{!opts.nocolor};
using Color = MaybeAnsi::Color; using Color = MaybeAnsi::Color;