mu: add 'label' command + manpage + tests

Add a label command and document it.
This commit is contained in:
Dirk-Jan C. Binnema
2025-07-27 09:24:57 +03:00
parent 1e628dfcab
commit 46fa4f2aa2
11 changed files with 1510 additions and 18 deletions

View File

@ -62,7 +62,7 @@ struct Options {
static bool default_no_color();
enum struct SubCommand {
Add, Cfind, Extract, Fields, Find, Help, Index,Info, Init, Mkdir,
Add, Cfind, Extract, Fields, Find, Help, Index,Info, Init, Label, Mkdir,
Move, Remove, Scm, Script, Server, Verify, View,
// <private>
__count__
@ -78,6 +78,7 @@ struct Options {
SubCommand::Index,
SubCommand::Info,
SubCommand::Init,
SubCommand::Label,
SubCommand::Mkdir,
SubCommand::Move,
SubCommand::Remove,
@ -200,6 +201,29 @@ struct Options {
} init;
/*
* Label
*/
struct Label {
OptString query; /**< Query for the messages to label */
bool dry_run{}; /**< Merely print the messages that would be
* labeled without doing so */
StringVec delta_labels; /**< labels to add (+) or remove (-) */
bool read_only{}; /** do not require writable store */
OptString file; /** file for import/export */
enum struct Sub { // sub-subcommands
Update, // add/remove labels
Clear, // clear all labels
List, // list all labels in the store
Export, // export labels
Import, // import labels
};
Sub sub;
} label;
/*
* Mkdir
*/