From: SeokYeon Hwang Date: Tue, 1 Nov 2016 00:58:25 +0000 (+0900) Subject: emulator: "--conf" should be first argument X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~20^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8be043116387c9dbe1154e7819feb922404b91dc;p=sdk%2Femulator%2Fqemu.git emulator: "--conf" should be first argument "--conf" should be first argument. Do not proceed if it is not. Print more kind usage if arguments are not valid. Change-Id: Ifb62075f3b130974b4a54d5900289c66c772dabd Signed-off-by: SeokYeon Hwang --- diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c index 94b0fcc2e9..e4a170754b 100644 --- a/tizen/src/emulator.c +++ b/tizen/src/emulator.c @@ -285,7 +285,10 @@ static int emulator_main(int argc, char *argv[], char **envp) set_variable(argv[optind - 1], argv[optind], true); break; case 'c': - launch_conf_file = g_strdup(optarg); + if (optind == 3) { + // "--conf" should be a first argument + launch_conf_file = g_strdup(optarg); + } break; case 'q': c = -1; @@ -297,8 +300,12 @@ static int emulator_main(int argc, char *argv[], char **envp) } if (!launch_conf_file && qemu_arg_index == 0) { - fprintf(stderr, "Usage: %s {-c|--conf} conf_file ...\n", - basename(argv[0])); + char *executable = basename(argv[0]); + fprintf(stderr, "Usage: %s {-c|--conf} conf_file [-- ]...\n" + " %*s [{-q|--qemu} ...]\n", + executable, (int)strlen(executable), ""); + fprintf(stderr, " %s {-q|--qemu} ...\n", + executable); return -1; }