提交 84c44613 编写于 作者: W Wenchao Xia 提交者: Luiz Capitulino

HMP: add sub command table to info

  Now info command takes a table of sub info commands,
and changed do_info() to do_info_help() to do help funtion
only.
 Note that now "info <unknown-topic>" returns error instead
of list of info topics.
Signed-off-by: NWenchao Xia <xiawenc@linux.vnet.ibm.com>
Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
上级 a13ced59
......@@ -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
......
......@@ -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");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部