diff mbox

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

Message ID ba02577cadbe5b53db791522310c977f9960f81f.1443790691.git.riku.voipio@linaro.org
State Accepted
Commit ba02577cadbe5b53db791522310c977f9960f81f
Headers show

Commit Message

Riku Voipio Oct. 2, 2015, 1 p.m. UTC
From: Meador Inge <meadori@codesourcery.com>

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 <meadori@codesourcery.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/main.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

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)) {