mirror of
https://github.com/ethauvin/bld.git
synced 2025-04-25 16:27:11 -07:00
Added ARGS_OPTION constant
This commit is contained in:
parent
c0418bb60a
commit
ecb72b6a7d
4 changed files with 17 additions and 9 deletions
8
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
8
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
|
@ -0,0 +1,8 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ADDITIONAL_TAGS" value="created" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
|
@ -1,4 +1,3 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PDMPlugin">
|
||||
<option name="skipTestSources" value="false" />
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
package rife.bld.help;
|
||||
|
||||
import rife.bld.CommandHelp;
|
||||
import rife.tools.StringUtils;
|
||||
import rife.bld.operations.RunOperation;
|
||||
|
||||
/**
|
||||
* Provides help for the run command.
|
||||
|
@ -19,9 +19,9 @@ public class RunHelp implements CommandHelp {
|
|||
}
|
||||
|
||||
public String getDescription(String topic) {
|
||||
return StringUtils.replace("""
|
||||
return String.format("""
|
||||
Runs the project.
|
||||
|
||||
Usage : ${topic} [--args=ARGUMENT...]""", "${topic}", topic);
|
||||
Usage : %s [%s=ARG...]""", topic, RunOperation.ARGS_OPTION);
|
||||
}
|
||||
}
|
|
@ -18,6 +18,7 @@ import java.util.List;
|
|||
* @since 1.5
|
||||
*/
|
||||
public class RunOperation extends AbstractProcessOperation<RunOperation> {
|
||||
public static final String ARGS_OPTION = "--args=";
|
||||
protected final List<String> runOptions_ = new ArrayList<>();
|
||||
|
||||
/**
|
||||
|
@ -60,8 +61,8 @@ public class RunOperation extends AbstractProcessOperation<RunOperation> {
|
|||
var arg = args.get(0);
|
||||
if (arg.startsWith("-")) {
|
||||
args.remove(0);
|
||||
if (arg.startsWith("--args=")) {
|
||||
var runArgs = arg.substring(7);
|
||||
if (arg.startsWith(ARGS_OPTION)) {
|
||||
var runArgs = arg.substring(ARGS_OPTION.length());
|
||||
if (!runArgs.isBlank()) {
|
||||
runOptions_.addAll(0, Arrays.asList(runArgs.split(" ")));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue