monitor: Point to "help" command on syntax error
authorBandan Das <bsd@redhat.com>
Wed, 3 Jun 2015 22:38:09 +0000 (18:38 -0400)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 22 Jun 2015 15:40:00 +0000 (17:40 +0200)
When a command fails due to incorrect syntax or input, suggest using
the "help" command to get more information about the command.  This
is only applicable for HMP.

Signed-off-by: Bandan Das <bsd@redhat.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
monitor.c

index e29ac74..4c7faf9 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -4069,6 +4069,8 @@ static void handle_hmp_command(Monitor *mon, const char *cmdline)
 
     qdict = monitor_parse_arguments(mon, &cmdline, cmd);
     if (!qdict) {
+        monitor_printf(mon, "Try \"help %s\" for more information\n",
+                       cmd->name);
         return;
     }