mu-init: guess maildir when --maildir is missing

Re-instate the guessing that's in the manpage. Add unit tests.
Update documentation.

Fixes #2616.
This commit is contained in:
Dirk-Jan C. Binnema
2024-01-01 10:02:56 +02:00
parent 8366e009cb
commit b4c768e6d0
6 changed files with 107 additions and 32 deletions

View File

@ -152,11 +152,11 @@ test_mu_index(size_t batch_size=0)
auto res1 = run_command({MU_PROGRAM, "--quiet", "init", "--batch-size",
mu_format("{}", batch_size == 0 ? 10000 : batch_size),
"--muhome", mu_home, "--maildir" , MU_TESTMAILDIR2});
assert_valid_result(res1);
assert_valid_command(res1);
auto res2 = run_command({MU_PROGRAM, "--quiet", "index",
"--muhome", mu_home});
assert_valid_result(res2);
assert_valid_command(res2);
auto&& store = unwrap(Store::make(join_paths(temp_dir.path(), "xapian")));
g_assert_cmpuint(store.size(),==,14);