Skip to content

Commit 1459b0d

Browse files
committed
fix splitting of multiple short-arguments
1 parent 5b90a6e commit 1459b0d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonMain.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,10 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
237237
break;
238238
} else if (!arg.startsWith("--") && arg.length() > 2) {
239239
// short arguments can be given together
240-
for (String optionChar : arg.substring(1).split("")) {
241-
arguments.add(i + 1, "-" + optionChar);
240+
String[] split = arg.substring(1).split("");
241+
for (int j = 0; j < split.length; j++) {
242+
String optionChar = split[j];
243+
arguments.add(i + 1 + j, "-" + optionChar);
242244
}
243245
} else {
244246
// possibly a polyglot argument

0 commit comments

Comments
 (0)