Skip to content

Commit 5e62590

Browse files
committed
fixing issues w/ argument inference
1 parent a412af4 commit 5e62590

6 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎koans/app/lib/file-compiler.jar‎

0 Bytes
Binary file not shown.

‎koans/app/lib/file-monitor.jar‎

166 Bytes
Binary file not shown.

‎koans/app/lib/koans.jar‎

508 Bytes
Binary file not shown.

‎koans/app/lib/util.jar‎

0 Bytes
Binary file not shown.

‎lib/koans-lib/src/com/sandwich/koan/cmdline/CommandLineArgumentBuilder.java‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class CommandLineArgumentBuilder extends LinkedHashMap<ArgumentType, Comm
1616
private static final long serialVersionUID = 7635285665311420603L;
1717

1818
public CommandLineArgumentBuilder(String...args){
19+
args = filterOutNullElements(args);
1920
if(args.length == 0){
2021
put(ArgumentType.RUN_KOANS, new CommandLineArgument(ArgumentType.RUN_KOANS, new String[0]));
2122
} else if (args.length == 1 && ArgumentType.findTypeByString(args[0]) == null){
@@ -52,6 +53,16 @@ public CommandLineArgumentBuilder(String...args){
5253
applyAssumedStartupBehaviors();
5354
}
5455

56+
private String[] filterOutNullElements(String... args) {
57+
List<String> tempArgs = new ArrayList<String>();
58+
for(String arg : args){
59+
if(arg != null && arg.trim().length() > 0){
60+
tempArgs.add(arg.trim());
61+
}
62+
}
63+
return tempArgs.toArray(new String[tempArgs.size()]);
64+
}
65+
5566
void applyAssumedStartupBehaviors() {
5667
if(ApplicationUtils.isFirstTimeAppHasBeenRun()){
5768
ArgumentType.BACKUP.run(new String[0]);

‎lib/koans-lib/src/com/sandwich/koan/cmdline/behavior/ClassArg.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public void run(String...koanSuiteClassName) {
99
koanSuiteClassName.length > 0 &&
1010
koanSuiteClassName[0] != null &&
1111
koanSuiteClassName[0].trim().length() != 0){
12+
System.out.println("filtering by suite: " + koanSuiteClassName[0]);
1213
PathToEnlightenment.filterBySuite(koanSuiteClassName[0]);
1314
}
1415
}

0 commit comments

Comments
 (0)