4690407: JAR tool: option -i can't be combined with other options

-i can't combined with cxut, do sanity check on options

Reviewed-by: martin
This commit is contained in:
Xueming Shen 2010-05-24 15:20:23 -04:00
parent 0bc8b10673
commit a7b730f127

View File

@ -306,28 +306,28 @@ class Main {
for (int i = 0; i < flags.length(); i++) { for (int i = 0; i < flags.length(); i++) {
switch (flags.charAt(i)) { switch (flags.charAt(i)) {
case 'c': case 'c':
if (xflag || tflag || uflag) { if (xflag || tflag || uflag || iflag) {
usageError(); usageError();
return false; return false;
} }
cflag = true; cflag = true;
break; break;
case 'u': case 'u':
if (cflag || xflag || tflag) { if (cflag || xflag || tflag || iflag) {
usageError(); usageError();
return false; return false;
} }
uflag = true; uflag = true;
break; break;
case 'x': case 'x':
if (cflag || uflag || tflag) { if (cflag || uflag || tflag || iflag) {
usageError(); usageError();
return false; return false;
} }
xflag = true; xflag = true;
break; break;
case 't': case 't':
if (cflag || uflag || xflag) { if (cflag || uflag || xflag || iflag) {
usageError(); usageError();
return false; return false;
} }
@ -349,6 +349,10 @@ class Main {
flag0 = true; flag0 = true;
break; break;
case 'i': case 'i':
if (cflag || uflag || xflag || tflag) {
usageError();
return false;
}
// do not increase the counter, files will contain rootjar // do not increase the counter, files will contain rootjar
rootjar = args[count++]; rootjar = args[count++];
iflag = true; iflag = true;