On Thu, Sep 24, 2015 at 09:00:43AM +0200, Patrick Ben Koetter wrote:
> Erroneously I tried to use the option 'delete' instead of 'destroy' when I ran
> the postmulti-command. My fault, but then the output - among many other
> options - stated, I should use 'delete' instead of 'delete':
>
> # postmulti -i postfix-test -e delete
> postmulti: fatal: Invalid '-e' edit action 'delete'. Specify 'create',
> 'destroy', 'import', 'deport', 'enable', 'disable', 'assign', 'init' or
> 'delete'
>
> This sounds like a bug to me. Some voice in the back of my head keeps telling
> me 'delete' was replaced by 'destroy' during the development of multiple
> instances. Maybe the 'delete' option wasn't removed from the output.
It is stranger than that, the final "or" argument is always what you typed:
case 'e':
if ((code = EDIT_CMD_CODE(optarg)) < 0)
msg_fatal("Invalid '-e' edit action '%s'. Specify '%s', "
"'%s', '%s', '%s', '%s', '%s', '%s', '%s' or '%s'",
optarg,
EDIT_CMD_STR(EDIT_CMD_CREATE),
EDIT_CMD_STR(EDIT_CMD_DESTROY),
EDIT_CMD_STR(EDIT_CMD_IMPORT),
EDIT_CMD_STR(EDIT_CMD_DEPORT),
EDIT_CMD_STR(EDIT_CMD_ENABLE),
EDIT_CMD_STR(EDIT_CMD_DISABLE),
EDIT_CMD_STR(EDIT_CMD_ASSIGN),
EDIT_CMD_STR(EDIT_CMD_INIT),
optarg);
Patch below:
diff --git a/src/postmulti/postmulti.c b/src/postmulti/postmulti.c
index 0d124ae..8fdc231 100644
--- a/src/postmulti/postmulti.c
+++ b/src/postmulti/postmulti.c
@@ -1711,7 +1711,7 @@ int main(int argc, char **argv)
case 'e':
if ((code = EDIT_CMD_CODE(optarg)) < 0)
msg_fatal("Invalid '-e' edit action '%s'. Specify '%s', "
- "'%s', '%s', '%s', '%s', '%s', '%s', '%s' or '%s'",
+ "'%s', '%s', '%s', '%s', '%s', '%s' or '%s'",
optarg,
EDIT_CMD_STR(EDIT_CMD_CREATE),
EDIT_CMD_STR(EDIT_CMD_DESTROY),
@@ -1720,8 +1720,7 @@ int main(int argc, char **argv)
EDIT_CMD_STR(EDIT_CMD_ENABLE),
EDIT_CMD_STR(EDIT_CMD_DISABLE),
EDIT_CMD_STR(EDIT_CMD_ASSIGN),
- EDIT_CMD_STR(EDIT_CMD_INIT),
- optarg);
+ EDIT_CMD_STR(EDIT_CMD_INIT));
if (cmd_mode != code)
command_mode_count++;
cmd_mode = code;
--
Viktor.