From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxOXb-0001Gl-RC for qemu-devel@nongnu.org; Tue, 26 May 2015 19:45:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxOXa-0005AK-Hp for qemu-devel@nongnu.org; Tue, 26 May 2015 19:45:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49916) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxOXa-0005AD-Cj for qemu-devel@nongnu.org; Tue, 26 May 2015 19:45:46 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id EA3EBB6A25 for ; Tue, 26 May 2015 23:45:45 +0000 (UTC) From: Bandan Das Date: Tue, 26 May 2015 19:45:17 -0400 Message-Id: <1432683917-19906-3-git-send-email-bsd@redhat.com> In-Reply-To: <1432683917-19906-1-git-send-email-bsd@redhat.com> References: <1432683917-19906-1-git-send-email-bsd@redhat.com> Subject: [Qemu-devel] [PATCH v2 2/2] monitor: suggest running "help" for command errors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: armbru@redhat.com 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. 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 Signed-off-by: Bandan Das --- monitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monitor.c b/monitor.c index f0c1a8c..af73195 100644 --- a/monitor.c +++ b/monitor.c @@ -4138,6 +4138,8 @@ static void handle_user_command(Monitor *mon, const char *cmdline) qdict = monitor_parse_arguments(mon, cmdline, &start, cmd); if (!qdict) { + monitor_printf(mon, "Try \"help %s\" for more information\n", + cmd->name); return; } -- 2.1.0