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>
This commit is contained in:
Meador Inge 2015-07-06 11:03:41 -07:00 committed by Riku Voipio
parent 4d1275c24d
commit ba02577cad

View File

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