qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] monitor: print message when using 'help' with an unknown command
@ 2018-07-19 15:03 Collin Walling
  2018-07-19 16:31 ` Markus Armbruster
  2018-07-19 19:18 ` Dr. David Alan Gilbert
  0 siblings, 2 replies; 9+ messages in thread
From: Collin Walling @ 2018-07-19 15:03 UTC (permalink / raw)
  To: qemu-devel

When typing 'help' followed by an unknown command, QEMU will
not print anything to the command line to let the user know
they typed a bad command. Let's fix this by printing a message
to the monitor when this happens. For example:

    (qemu) help xyz
    unknown command: 'xyz'

Reported-by: Stefan Zimmermann <stzi@linux.ibm.com>
Signed-off-by: Collin Walling <walling@linux.ibm.com>
---
 monitor.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/monitor.c b/monitor.c
index 7af1f18..7942f9f 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1034,9 +1034,12 @@ static void help_cmd_dump(Monitor *mon, const mon_cmd_t *cmds,
             } else {
                 help_cmd_dump_one(mon, cmd, args, arg_index);
             }
-            break;
+            return;
         }
     }
+
+    /* Entry not found */
+    monitor_printf(mon, "unknown command: '%s'\n", args[arg_index]);
 }
 
 static void help_cmd(Monitor *mon, const char *name)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-07-20 19:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-19 15:03 [Qemu-devel] [PATCH] monitor: print message when using 'help' with an unknown command Collin Walling
2018-07-19 16:31 ` Markus Armbruster
2018-07-19 16:39   ` Collin Walling
2018-07-20 16:40     ` Eric Blake
2018-07-20 19:37       ` Collin Walling
2018-07-19 19:11   ` Dr. David Alan Gilbert
2018-07-19 19:18 ` Dr. David Alan Gilbert
2018-07-19 20:34   ` Collin Walling
2018-07-20 18:44     ` Dr. David Alan Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).