diff --git a/TODO b/TODO index bf42882e..b6dd3555 100644 --- a/TODO +++ b/TODO @@ -8,6 +8,8 @@ - [X] check which options actually work, remove rest - [X] fix AND/OR escaping issue - [ ] man page / help + - [ ] add mkmdir + - [ ] re-add symlink support for search - [X] support MAILDIR - [X] config system (centralize options) - [X] logging system @@ -28,7 +30,6 @@ - [ ] add move-mail support - [ ] add mu cleanup - [ ] add symlink-following option for index - - [ ] re-add symlink support for search - [ ] document support for mutt, wanderlust - [ ] test suite - [ ] moving msg field formatting to MuMsgField diff --git a/src/Makefile.am b/src/Makefile.am index abbd1c67..34d425ce 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -10,6 +10,8 @@ mu_SOURCES= \ mu-index.h \ mu-log.c \ mu-log.h \ + mu-maildir.c \ + mu-maildir.h \ mu-msg-fields.c \ mu-msg-fields.h \ mu-msg-flags.c \ diff --git a/src/mu-config.c b/src/mu-config.c index 23739bed..3cc590cd 100644 --- a/src/mu-config.c +++ b/src/mu-config.c @@ -146,3 +146,4 @@ mu_config_uninit (MuConfigOptions *opts) g_strfreev (opts->params); } + diff --git a/src/mu-config.h b/src/mu-config.h index ba5574b1..8a3b5688 100644 --- a/src/mu-config.h +++ b/src/mu-config.h @@ -102,6 +102,7 @@ GOptionGroup* mu_config_options_group_index (MuConfigOptions *opts); GOptionGroup* mu_config_options_group_query (MuConfigOptions *opts); + char* mu_config_expanded_mu_home (MuConfigOptions *opts); #endif /*__MU_CONFIG_H__*/ diff --git a/src/mu.c b/src/mu.c index 123494f7..172fe6d6 100644 --- a/src/mu.c +++ b/src/mu.c @@ -26,6 +26,8 @@ #include "mu-index.h" #include "mu-query.h" +#include "mu-maildir.h" + #include "mu-util.h" #include "mu-config.h" #include "mu-log.h" @@ -35,6 +37,7 @@ enum _MuCmd { MU_CMD_INDEX, MU_CMD_QUERY, + MU_CMD_MKDIR, MU_CMD_HELP, MU_CMD_UNKNOWN }; @@ -56,10 +59,14 @@ parse_cmd (const char* cmd) (strcmp (cmd, "search") == 0)) return MU_CMD_QUERY; + if ((strcmp (cmd, "mkmdir") == 0) || + (strcmp (cmd, "mkdir") == 0)) + return MU_CMD_MKDIR; + if ((strcmp (cmd, "help") == 0) || (strcmp (cmd, "info") == 0)) return MU_CMD_HELP; - + return MU_CMD_UNKNOWN; } @@ -88,16 +95,53 @@ msg_cb (MuIndexStats* stats, void *user_data) return MU_OK; } + static int -show_help (const char* cmd) +make_maildir (MuConfigOptions *opts) { - if (cmd) - g_print ("Help about %s\n", cmd); - else - g_print ("General help\n"); + int i; + if (!opts->params[0]) + return 1; /* shouldn't happen */ + + if (!opts->params[1]) { + g_printerr ("usage: mu mkdir