[DEV] update parsing of arguments
This commit is contained in:
parent
1641e854df
commit
74e0a8dff2
@ -1,5 +1,5 @@
|
|||||||
package org.atriasoft.death;
|
package org.atriasoft.death;
|
||||||
|
|
||||||
record ArgChoice(String val, String description) {
|
public record ArgChoice(String val, String description) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -70,22 +70,19 @@ public class Arguments {
|
|||||||
this.listProperties.add(new ArgSection(sectionName, sectionDesc));
|
this.listProperties.add(new ArgSection(sectionName, sectionDesc));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void parse(final List<String> args) {
|
public List<ArgElement> parse(final List<String> args) {
|
||||||
parse(args, 1);
|
return parse(args, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void parse(final List<String> args, final int startPositionParsing) {
|
|
||||||
parse(args, startPositionParsing, false);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Parse the argument set in the command line
|
* Parse the argument set in the command line
|
||||||
* @param this Class handle
|
* @param this Class handle
|
||||||
* @param startPositionParsing position to start the parsing in the arguments
|
* @param startPositionParsing position to start the parsing in the arguments
|
||||||
*/
|
*/
|
||||||
public List<ArgElement> parse(final List<String> args, final int startPositionParsing, final boolean haveUnknowArgument) {
|
public List<ArgElement> parse(final List<String> args, final boolean haveUnknowArgument) {
|
||||||
List<ArgElement> listArgument = new ArrayList<>();// composed of list element
|
List<ArgElement> listArgument = new ArrayList<>();// composed of list element
|
||||||
boolean notParseNextElement=false;
|
boolean notParseNextElement=false;
|
||||||
for (int iii=startPositionParsing; iii <args.size(); iii++){
|
for (int iii=0; iii <args.size(); iii++){
|
||||||
this.lastElementParsed = iii;
|
this.lastElementParsed = iii;
|
||||||
// special case of parameter in some elements
|
// special case of parameter in some elements
|
||||||
if ( notParseNextElement) {
|
if ( notParseNextElement) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user