mu: check --maildir parameter for init

Fixes #1568.
This commit is contained in:
Dirk-Jan C. Binnema
2020-02-09 22:40:57 +02:00
parent 85df5524f3
commit 36b31eeb0a
2 changed files with 28 additions and 10 deletions

View File

@ -563,8 +563,16 @@ cmd_info (MuStore *store, MuConfig *opts, GError **err)
static MuError static MuError
cmd_init (MuConfig *opts, GError **err) cmd_init (MuConfig *opts, GError **err)
{ {
MuStore *store; MuStore *store;
const char *path; const char *path;
/* not provided, nor could we find a good default */
if (!opts->maildir) {
mu_util_g_set_error (err, MU_ERROR_IN_PARAMETERS,
"missing --maildir parameter and could "
"not determine default");
return MU_ERROR_IN_PARAMETERS;
}
path = mu_runtime_path(MU_RUNTIME_PATH_XAPIANDB); path = mu_runtime_path(MU_RUNTIME_PATH_XAPIANDB);
store = mu_store_new_create (path, store = mu_store_new_create (path,

View File

@ -1,6 +1,6 @@
#-*-mode:org-*- #-*-mode:org-*-
# #
# Copyright (C) 2012-2013 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> # Copyright (C) 2012-2020 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -111,15 +111,28 @@ directories and storing the results in a Xapian database.The
data can then be queried using mu-find(1). data can then be queried using mu-find(1).
#END #END
#BEGIN MU_CONFIG_CMD_INIT
#STRING
mu init [options]
#STRING
mu init is the mu command for setting up the mu database.
#END
#BEGIN MU_CONFIG_CMD_INFO
#STRING
mu init [options]
#STRING
mu info is the command for getting information about a mu database.
#END
#BEGIN MU_CONFIG_CMD_MKDIR #BEGIN MU_CONFIG_CMD_MKDIR
#STRING #STRING
mu mkdir [options] <dir> [<dirs>] mu mkdir [options] <dir> [<dirs>]
#STRING #STRING
mu mkdir is the mu command for creating Maildirs.It does not mu mkdir is the command for creating Maildirs.It does not
use the mu database. use the mu database.
#END #END
#BEGIN MU_CONFIG_CMD_REMOVE #BEGIN MU_CONFIG_CMD_REMOVE
#STRING #STRING
mu remove [options] <file> [<files>] mu remove [options] <file> [<files>]
@ -127,19 +140,16 @@ mu remove [options] <file> [<files>]
mu remove is the mu command to remove messages from the database. mu remove is the mu command to remove messages from the database.
#END #END
#BEGIN MU_CONFIG_CMD_SERVER #BEGIN MU_CONFIG_CMD_SERVER
#STRING #STRING
mu server [options] mu server [options]
#STRING #STRING
mu server starts a simple shell in which one can query and mu server starts a simple shell in which one can query and
manipulate the mu database.The output of the commands is terms manipulate the mu database.The output of the commands is terms
of Lisp symbolic expressions (s-exps).mu server is not meant for of Lisp symbolic expressions (s-exps). Its main use is for
use by humans; instead, it is designed specificallyfor the the mu4e e-mail client.
mu4e e-mail client.
#END #END
#BEGIN MU_CONFIG_CMD_SCRIPT #BEGIN MU_CONFIG_CMD_SCRIPT
#STRING #STRING
mu script [<pattern>] [-v] mu script [<pattern>] [-v]