aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorMeador Inge <meadori@codesourcery.com>2015-07-06 11:03:41 -0700
committerRiku Voipio <riku.voipio@linaro.org>2015-09-28 16:13:22 +0300
commitba02577cadbe5b53db791522310c977f9960f81f (patch)
tree173a06b76f27464a4cac5dc83a6cccc497537f29 /linux-user
parent4d1275c24d5d64d22ec4a30ce1b6a0db3ba9a25a (diff)
linux-user: Treat --foo options the same as -foo
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>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index c7c39d4d5c..6599a41404 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)) {