summaryrefslogtreecommitdiff
path: root/src/cz/crcs/ectester/common/cli/TreeCommandLine.java
diff options
context:
space:
mode:
authorJ08nY2017-11-18 15:16:05 +0100
committerJ08nY2017-11-18 15:16:05 +0100
commitfa6cea35cb6899f802d24951bf5e12639a251eb6 (patch)
treeeae7fb39773ccf3bd620d6645bb9d99cc3f5f836 /src/cz/crcs/ectester/common/cli/TreeCommandLine.java
parent9da5f6ee8db4138b13af6d1d7bef279ed107288d (diff)
downloadECTester-fa6cea35cb6899f802d24951bf5e12639a251eb6.tar.gz
ECTester-fa6cea35cb6899f802d24951bf5e12639a251eb6.tar.zst
ECTester-fa6cea35cb6899f802d24951bf5e12639a251eb6.zip
Diffstat (limited to 'src/cz/crcs/ectester/common/cli/TreeCommandLine.java')
-rw-r--r--src/cz/crcs/ectester/common/cli/TreeCommandLine.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/cz/crcs/ectester/common/cli/TreeCommandLine.java b/src/cz/crcs/ectester/common/cli/TreeCommandLine.java
index ef6079e..e0927fa 100644
--- a/src/cz/crcs/ectester/common/cli/TreeCommandLine.java
+++ b/src/cz/crcs/ectester/common/cli/TreeCommandLine.java
@@ -5,6 +5,8 @@ import org.apache.commons.cli.Option;
import org.apache.commons.cli.ParseException;
import java.util.Iterator;
+import java.util.List;
+import java.util.Objects;
import java.util.Properties;
import java.util.function.BiFunction;
@@ -45,6 +47,10 @@ public class TreeCommandLine extends CommandLine {
return next;
}
+ public boolean isNext(String next) {
+ return Objects.equals(getNextName(), next);
+ }
+
public CommandLine getThis() {
return cli;
}
@@ -131,4 +137,21 @@ public class TreeCommandLine extends CommandLine {
public Option[] getOptions() {
return cli.getOptions();
}
+
+ public String getArg(int index) {
+ if (index < 0 || index >= cli.getArgs().length) {
+ return null;
+ }
+ return cli.getArgs()[index];
+ }
+
+ @Override
+ public String[] getArgs() {
+ return cli.getArgs();
+ }
+
+ @Override
+ public List<String> getArgList() {
+ return cli.getArgList();
+ }
}