This patch modified auto completion a bit, to make it work when there is a folded sub command group, for example, "info" is a sub command group of root command group.
Note that at patch 1, the parameter *mon and *cmd_table is brought until monitor_init() level. If *cmd_table is added also in it, a monitor can be created with different command tables, but that requirement do not exist yet, so not changed it to save trouble. Wenchao Xia (2): 1) monitor: discard global variable in auto completion functions 2) monitor: support sub commands in auto completion include/monitor/readline.h | 8 ++++- monitor.c | 78 ++++++++++++++++++++++++++------------------ readline.c | 4 ++- 3 files changed, 56 insertions(+), 34 deletions(-)