Skip to content

Commit

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

struct doveadm_mail_cmd cmd_deduplicate = {
cmd_deduplicate_alloc, "deduplicate", "[-m] <search query>"
struct doveadm_cmd_ver2 doveadm_cmd_deduplicate_ver2 = {
.name = "deduplicate",
.mail_cmd = cmd_deduplicate_alloc,
.usage = DOVEADM_CMD_MAIL_USAGE_PREFIX "[-m] <search query>",
DOVEADM_CMD_PARAMS_START
DOVEADM_CMD_MAIL_COMMON
DOVEADM_CMD_PARAM('m', "by-msgid", CMD_PARAM_BOOL, 0)
DOVEADM_CMD_PARAM('\0', "query", CMD_PARAM_ARRAY, CMD_PARAM_FLAG_POSITIONAL)
DOVEADM_CMD_PARAMS_END
};
4 changes: 2 additions & 2 deletions src/doveadm/doveadm-mail.c
Expand Up @@ -830,7 +830,6 @@ static struct doveadm_mail_cmd *mail_commands[] = {
&cmd_flags_replace,
&cmd_import,
&cmd_copy,
&cmd_deduplicate,
&cmd_move,
&cmd_batch,
&cmd_dsync_backup,
Expand All @@ -853,7 +852,8 @@ static struct doveadm_cmd_ver2 *mail_commands_ver2[] = {
&doveadm_cmd_fetch_ver2,
&doveadm_cmd_save_ver2,
&doveadm_cmd_index_ver2,
&doveadm_cmd_altmove_ver2
&doveadm_cmd_altmove_ver2,
&doveadm_cmd_deduplicate_ver2
};

void doveadm_mail_init(void)
Expand Down
2 changes: 1 addition & 1 deletion src/doveadm/doveadm-mail.h
Expand Up @@ -176,7 +176,6 @@ 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_copy;
extern struct doveadm_mail_cmd cmd_deduplicate;
extern struct doveadm_mail_cmd cmd_move;
extern struct doveadm_mail_cmd cmd_batch;

Expand All @@ -195,6 +194,7 @@ 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;
extern struct doveadm_cmd_ver2 doveadm_cmd_altmove_ver2;
extern struct doveadm_cmd_ver2 doveadm_cmd_deduplicate_ver2;

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

0 comments on commit e1d08b1

Please sign in to comment.