diff mbox

[v4,2/4] 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.

Message ID 1433302122-27397-3-git-send-email-bsd@redhat.com
State New
Headers show

Commit Message

Bandan Das June 3, 2015, 3:28 a.m. UTC
Before:
(qemu) drive_add usb_flash_drive
drive_add: string expected
After:
(qemu) drive_add usb_flash_drive
drive_add: string expected
Try "help drive_add" for more information

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Bandan Das <bsd@redhat.com>
---
 monitor.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Markus Armbruster June 3, 2015, 11:30 a.m. UTC | #1
Patch is fine, but the commit message shouldn't be just one long line.
Suggest:

    monitor: Point to "help" command on syntax error

    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>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>

Missed that in my original review, sorry.
diff mbox

Patch

diff --git a/monitor.c b/monitor.c
index a89cbbb..6777cbe 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4134,6 +4134,8 @@  static void handle_user_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;
     }