Skip to content

Commit

Permalink
doveadm-index: Use ver2 structures
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse authored and sirainen committed Feb 22, 2016
1 parent 3fd8086 commit 71f4549
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
12 changes: 10 additions & 2 deletions src/doveadm/doveadm-mail-index.c
Expand Up @@ -274,6 +274,14 @@ static struct doveadm_mail_cmd_context *cmd_index_alloc(void)
return &ctx->ctx;
}

struct doveadm_mail_cmd cmd_index = {
cmd_index_alloc, "index", "[-q] [-n <max recent>] <mailbox mask>"
struct doveadm_cmd_ver2 doveadm_cmd_index_ver2 = {
.name = "index",
.usage = "[-q] [-n <max recent>] <mailbox mask>",
.mail_cmd = cmd_index_alloc,
DOVEADM_CMD_PARAMS_START
DOVEADM_CMD_MAIL_COMMON
DOVEADM_CMD_PARAM('q',"queue",CMD_PARAM_BOOL,0)
DOVEADM_CMD_PARAM('n',"max-recent",CMD_PARAM_STR,0)
DOVEADM_CMD_PARAM('\0',"mailbox-mask",CMD_PARAM_STR,CMD_PARAM_FLAG_POSITIONAL)
DOVEADM_CMD_PARAMS_END
};
4 changes: 2 additions & 2 deletions src/doveadm/doveadm-mail.c
Expand Up @@ -825,7 +825,6 @@ static struct doveadm_mail_cmd *mail_commands[] = {
&cmd_flags_remove,
&cmd_flags_replace,
&cmd_import,
&cmd_index,
&cmd_altmove,
&cmd_copy,
&cmd_deduplicate,
Expand All @@ -849,7 +848,8 @@ static struct doveadm_cmd_ver2 *mail_commands_ver2[] = {
&doveadm_cmd_mailbox_subscribe_ver2,
&doveadm_cmd_mailbox_unsubscribe_ver2,
&doveadm_cmd_fetch_ver2,
&doveadm_cmd_save_ver2
&doveadm_cmd_save_ver2,
&doveadm_cmd_index_ver2
};

void doveadm_mail_init(void)
Expand Down
2 changes: 1 addition & 1 deletion src/doveadm/doveadm-mail.h
Expand Up @@ -175,7 +175,6 @@ extern struct doveadm_mail_cmd cmd_flags_add;
extern struct doveadm_mail_cmd cmd_flags_remove;
extern struct doveadm_mail_cmd cmd_flags_replace;
extern struct doveadm_mail_cmd cmd_import;
extern struct doveadm_mail_cmd cmd_index;
extern struct doveadm_mail_cmd cmd_altmove;
extern struct doveadm_mail_cmd cmd_copy;
extern struct doveadm_mail_cmd cmd_deduplicate;
Expand All @@ -195,6 +194,7 @@ extern struct doveadm_cmd_ver2 doveadm_cmd_mailbox_subscribe_ver2;
extern struct doveadm_cmd_ver2 doveadm_cmd_mailbox_unsubscribe_ver2;
extern struct doveadm_cmd_ver2 doveadm_cmd_fetch_ver2;
extern struct doveadm_cmd_ver2 doveadm_cmd_save_ver2;
extern struct doveadm_cmd_ver2 doveadm_cmd_index_ver2;

#define DOVEADM_CMD_MAIL_COMMON \
DOVEADM_CMD_PARAM('A', "all-users", CMD_PARAM_BOOL, 0) \
Expand Down

0 comments on commit 71f4549

Please sign in to comment.