]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: cli: filter the list of commands to the matching part
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Mar 2021 16:13:28 +0000 (17:13 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Mar 2021 18:09:19 +0000 (19:09 +0100)
commitb96a74cbfd0e8cfc755d36cfa5ee8c4d95e89dda
tree2bb7b828e610e0b37810c152d308e3f313abc9e4
parentf3697dde2b8e79604f9d0b5f81497d0e52a773b1
MINOR: cli: filter the list of commands to the matching part

The error message on the CLI has become unreadable due to the long list
and it's not even sorted, making it even harder to figure the right
command.

This patch starts by looking if some of the words match something known,
and if so, will limit the listing only to those commands that start like
the current one. The "help", "prompt" and "quit" commands are always
shown to help the user try something else. Now thanks to this, typing
"add" or "del" will only list "add acl", "add map" and not 50 lines
anymore.

As a small bonus, we won't print "Unknown command" anymore in response
to the "help" command.
src/cli.c