qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 05/13] linux-user: Treat --foo options the same as -f


From: riku . voipio
Subject: [Qemu-devel] [PULL 05/13] linux-user: Treat --foo options the same as -foo
Date: Fri, 2 Oct 2015 16:00:57 +0300

From: Meador Inge <address@hidden>

The system mode binaries provide a similar alias
and it makes common options like --version and --help
work as expected.

Signed-off-by: Meador Inge <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
 linux-user/main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/linux-user/main.c b/linux-user/main.c
index c7c39d4..6599a41 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -4024,6 +4024,10 @@ static int parse_args(int argc, char **argv)
         if (!strcmp(r, "-")) {
             break;
         }
+        /* Treat --foo the same as -foo.  */
+        if (r[0] == '-') {
+            r++;
+        }
 
         for (arginfo = arg_table; arginfo->handle_opt != NULL; arginfo++) {
             if (!strcmp(r, arginfo->argv)) {
-- 
2.5.3




reply via email to

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