diff --git a/src/mu-index.c b/src/mu-index.c index 781b68c7..993a3c7e 100644 --- a/src/mu-index.c +++ b/src/mu-index.c @@ -32,6 +32,41 @@ #include "mu-index.h" #include "mu-store-xapian.h" +struct _IndexOptions { + gboolean quiet; + gboolean cleanup; + gboolean reindex; + const char *maildir; +}; +typedef struct _IndexOptions IndexOptions; + +static IndexOptions INDEX_OPTIONS; +static GOptionEntry INDEX_ENTRIES[] = { + {"maildir", 'm', 0, G_OPTION_ARG_FILENAME, &INDEX_OPTIONS.maildir, + "top of the maildir", NULL}, + + /* FIXME: implement this */ + {"reindex", 'r', 0, G_OPTION_ARG_NONE, &INDEX_OPTIONS.reindex, + "re-index already indexed messages ", NULL}, + {NULL} +}; + + +GOptionGroup* +mu_index_option_group (void) +{ + GOptionGroup *og; + + og = g_option_group_new ("index", + "options for indexing your maildirs", + "", NULL, NULL); + + g_option_group_add_entries (og, INDEX_ENTRIES); + + return og; +} + + struct _MuIndex { MuStoreXapian *_xapian; }; @@ -282,3 +317,5 @@ mu_index_cleanup (MuIndex *index, MuIndexStats *stats, /* FIXME: implement this */ return MU_OK; } + + diff --git a/src/mu-index.h b/src/mu-index.h index 58645109..f9dbe4fe 100644 --- a/src/mu-index.h +++ b/src/mu-index.h @@ -142,4 +142,12 @@ MuResult mu_index_cleanup (MuIndex *index, MuIndexStats *result, MuIndexMsgCallback msg_cb, MuIndexDirCallback dir_cb, void *user_data); + +/** + * get the option group for 'index' + * + * @return an option group + */ +GOptionGroup* mu_index_option_group (void); + #endif /*__MU_INDEX_H__*/