diff --git a/include/haproxy/cli-t.h b/include/haproxy/cli-t.h index f3b931f9b..45eed35bc 100644 --- a/include/haproxy/cli-t.h +++ b/include/haproxy/cli-t.h @@ -41,11 +41,12 @@ #define ACCESS_MCLI_SEVERITY_STR 0x0200 /* 'set severity-output string' on master CLI */ /* flags for appctx->st1 */ -#define APPCTX_CLI_ST1_PROMPT (1 << 0) -#define APPCTX_CLI_ST1_PAYLOAD (1 << 1) -#define APPCTX_CLI_ST1_NOLF (1 << 2) -#define APPCTX_CLI_ST1_TIMED (1 << 3) -#define APPCTX_CLI_ST1_LASTCMD (1 << 4) +#define APPCTX_CLI_ST1_PAYLOAD (1 << 0) +#define APPCTX_CLI_ST1_NOLF (1 << 1) +#define APPCTX_CLI_ST1_LASTCMD (1 << 2) +#define APPCTX_CLI_ST1_INTER (1 << 3) /* interactive mode (i.e. don't close after 1st cmd) */ +#define APPCTX_CLI_ST1_PROMPT (1 << 4) /* display prompt */ +#define APPCTX_CLI_ST1_TIMED (1 << 5) /* display timer in prompt */ #define CLI_PREFIX_KW_NB 5 #define CLI_MAX_MATCHES 5 diff --git a/src/cli.c b/src/cli.c index 5791a89ce..663bdad69 100644 --- a/src/cli.c +++ b/src/cli.c @@ -1260,7 +1260,7 @@ void cli_io_handler(struct appctx *appctx) appctx->cli_ctx.payload = NULL; appctx->cli_ctx.cmdline = NULL; appctx->st1 &= ~APPCTX_CLI_ST1_LASTCMD; - if (appctx->st1 & APPCTX_CLI_ST1_PROMPT) { + if (appctx->st1 & APPCTX_CLI_ST1_INTER) { appctx->st0 = CLI_ST_PARSE_CMDLINE; applet_will_consume(appctx); applet_expect_data(appctx); @@ -2497,11 +2497,11 @@ static int cli_parse_simple(char **args, char *payload, struct appctx *appctx, v else if (*args[0] == 'p') /* prompt */ if (strcmp(args[1], "timed") == 0) { - appctx->st1 |= APPCTX_CLI_ST1_PROMPT; + appctx->st1 |= APPCTX_CLI_ST1_PROMPT | APPCTX_CLI_ST1_INTER; appctx->st1 ^= APPCTX_CLI_ST1_TIMED; } else - appctx->st1 ^= APPCTX_CLI_ST1_PROMPT; + appctx->st1 ^= APPCTX_CLI_ST1_PROMPT | APPCTX_CLI_ST1_INTER; else if (*args[0] == 'q') { /* quit */ applet_set_eoi(appctx);