qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] block: fix qemu-img --help invocation


From: Jeff Cody
Subject: [Qemu-devel] [PATCH] block: fix qemu-img --help invocation
Date: Fri, 25 Apr 2014 14:27:21 -0400

This fixes a bug introduced in commit ac1307ab, that caused the
'--help' option to not be recognized as a valid command, and not
print any help.

This also restores the previous behavior of qemu-img printing the full
help when called with no arguments.

Signed-off-by: Jeff Cody <address@hidden>
---
 qemu-img.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index 4dae84a..3f878f6 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2800,7 +2800,7 @@ int main(int argc, char **argv)
     qemu_init_main_loop();
     bdrv_init();
     if (argc < 2) {
-        error_exit("Not enough arguments");
+        help();
     }
     cmdname = argv[1];
     argc--; argv++;
@@ -2813,5 +2813,6 @@ int main(int argc, char **argv)
     }
 
     /* not found */
-    error_exit("Command not found: %s", cmdname);
+    help();
+    return 0; /* never reached */
 }
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]