From c635b25b6f7a69f29c1730205efb5ebfad0302e0 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sat, 19 Aug 2023 18:38:44 -0700 Subject: [PATCH] Fixed RunOption args parsing --- .../java/rife/bld/operations/RunOperation.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/rife/bld/operations/RunOperation.java b/src/main/java/rife/bld/operations/RunOperation.java index 459aba3..35968cb 100644 --- a/src/main/java/rife/bld/operations/RunOperation.java +++ b/src/main/java/rife/bld/operations/RunOperation.java @@ -48,24 +48,22 @@ protected List 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(" "))); } } }