Skip to content

Commit

Permalink
Merge pull request #5 from ethauvin/main
Browse files Browse the repository at this point in the history
Fixed RunOption args parsing
  • Loading branch information
gbevin authored Aug 20, 2023
2 parents ba28294 + c635b25 commit 8d707a7
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/main/java/rife/bld/operations/RunOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,22 @@ protected List<String> executeConstructProcessCommandList() {
*/
public RunOperation fromProject(BaseProject project) {
var operation = workDirectory(project.workDirectory())
.javaTool(project.javaTool())
.classpath(project.runClasspath())
.mainClass(project.mainClass());
.javaTool(project.javaTool())
.classpath(project.runClasspath())
.mainClass(project.mainClass());
if (project.usesRife2Agent()) {
operation.javaOptions().javaAgent(project.getRife2AgentFile());
}

// parse the run arguments if any
var args = project.arguments();
while (!args.isEmpty()) {
if (!args.isEmpty()) {
var arg = args.get(0);
if (arg.startsWith("-")) {
if (arg.startsWith(ARGS_OPTION)) {
args.remove(0);
if (arg.startsWith(ARGS_OPTION)) {
var runArgs = arg.substring(ARGS_OPTION.length());
if (!runArgs.isBlank()) {
runOptions_.addAll(0, Arrays.asList(runArgs.split(" ")));
}
var runArgs = arg.substring(ARGS_OPTION.length());
if (!runArgs.isBlank()) {
runOptions_.addAll(0, Arrays.asList(runArgs.split(" ")));
}
}
}
Expand Down

0 comments on commit 8d707a7

Please sign in to comment.