Skip to content

Commit

Permalink
improved curl import
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Mucha committed Mar 6, 2024
1 parent c504387 commit 87b2d91
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,20 @@ private String extractUrl(List<String> argumentList) {
if (values.size() > 0) {
return values.get(0);
}
for (int i = 1; i < argumentList.size(); i++) {
String argument = argumentList.get(i);

//return last argument
return argumentList.get(argumentList.size() - 1);
if (argument.startsWith("-")) {
//skip argument for non-unary arguments
if (!argument.equalsIgnoreCase("--compressed")) {
i += 1;
}
continue;
}
return argument;
}

throw new RuntimeException("Failed to extract url");
}


Expand Down

0 comments on commit 87b2d91

Please sign in to comment.