From: Willy Tarreau Date: Mon, 7 Sep 2026 14:25:18 +0000 (+0200) Subject: MINOR: ring/cli: also support "show events -h" to display the help X-Git-Tag: v3.5-dev7~65 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=ae5671658661bd69cdf831ea42437b5769e769c5;p=haproxy.git MINOR: ring/cli: also support "show events -h" to display the help Till now it was annoyingly showing "unknown option" which was not much helpful. --- diff --git a/doc/management.txt b/doc/management.txt index 02f3aeef6..02780b989 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -3196,6 +3196,8 @@ show events [-[wn0rs]*] [] character ('\0' or 0), which might be more convenient for external tools. + -h show the help message. + -n directly seeks to the end of the buffer, which is generally combined with "-w" to only report new events (like "tail -f"). diff --git a/src/sink.c b/src/sink.c index 1b43343ca..d6b6c15f8 100644 --- a/src/sink.c +++ b/src/sink.c @@ -379,6 +379,7 @@ static int cli_parse_show_events(char **args, char *payload, struct appctx *appc case 'w' : ring_flags |= RING_WF_WAIT_MODE; break; case 's' : ring_flags |= RING_WF_SANITIZE; break; case 'r' : ring_flags &= ~RING_WF_SANITIZE; break; + case 'h' : goto show_help; default: return cli_err(appctx, "unknown option"); } } @@ -386,6 +387,7 @@ static int cli_parse_show_events(char **args, char *payload, struct appctx *appc if (!name) { /* no arg => report the list of supported sink */ + show_help: chunk_printf(&trash, "Supported events sinks are listed below. Add combinations of -0(zero), -w(wait), -n(new), -r(raw), -s(anitize). Any key to stop.\n"); list_for_each_entry(sink, &sink_list, sink_list) { chunk_appendf(&trash, " %-10s : type=%s, %u dropped, %s\n", @@ -1503,7 +1505,7 @@ REGISTER_POST_CHECK(sink_postcheck); REGISTER_POST_DEINIT(sink_deinit); static struct cli_kw_list cli_kws = {{ },{ - { { "show", "events", NULL }, "show events [-0nrsw]* [] : show event sink state", cli_parse_show_events, NULL, NULL }, + { { "show", "events", NULL }, "show events [-0hnrsw]* [] : show event sink state", cli_parse_show_events, NULL, NULL }, {{},} }};