aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hmp-commands.hx3
-rw-r--r--monitor.c22
2 files changed, 3 insertions, 22 deletions
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 67569eff4a..0934b9b915 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1521,7 +1521,8 @@ ETEXI
.args_type = "item:s?",
.params = "[subcommand]",
.help = "show various information about the system state",
- .mhandler.cmd = do_info,
+ .mhandler.cmd = do_info_help,
+ .sub_table = info_cmds,
},
STEXI
diff --git a/monitor.c b/monitor.c
index ef1b7ac062..20bd19b05f 100644
--- a/monitor.c
+++ b/monitor.c
@@ -811,28 +811,8 @@ static void user_async_cmd_handler(Monitor *mon, const mon_cmd_t *cmd,
}
}
-static void do_info(Monitor *mon, const QDict *qdict)
+static void do_info_help(Monitor *mon, const QDict *qdict)
{
- const mon_cmd_t *cmd;
- const char *item = qdict_get_try_str(qdict, "item");
-
- if (!item) {
- goto help;
- }
-
- for (cmd = info_cmds; cmd->name != NULL; cmd++) {
- if (compare_cmd(item, cmd->name))
- break;
- }
-
- if (cmd->name == NULL) {
- goto help;
- }
-
- cmd->mhandler.cmd(mon, NULL);
- return;
-
-help:
help_cmd(mon, "info");
}