From 74e0a8dff2401934bf8e90013f07c0c553862dc0 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Thu, 17 Jun 2021 22:34:47 +0200 Subject: [PATCH] [DEV] update parsing of arguments --- src/org/atriasoft/death/ArgChoice.java | 2 +- src/org/atriasoft/death/Arguments.java | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/org/atriasoft/death/ArgChoice.java b/src/org/atriasoft/death/ArgChoice.java index 6a53d7d..a678c49 100644 --- a/src/org/atriasoft/death/ArgChoice.java +++ b/src/org/atriasoft/death/ArgChoice.java @@ -1,5 +1,5 @@ package org.atriasoft.death; -record ArgChoice(String val, String description) { +public record ArgChoice(String val, String description) { } diff --git a/src/org/atriasoft/death/Arguments.java b/src/org/atriasoft/death/Arguments.java index 682c04a..e804451 100644 --- a/src/org/atriasoft/death/Arguments.java +++ b/src/org/atriasoft/death/Arguments.java @@ -70,22 +70,19 @@ public class Arguments { this.listProperties.add(new ArgSection(sectionName, sectionDesc)); } - public void parse(final List args) { - parse(args, 1); + public List parse(final List args) { + return parse(args, false); } - public void parse(final List args, final int startPositionParsing) { - parse(args, startPositionParsing, false); - } /** * Parse the argument set in the command line * @param this Class handle * @param startPositionParsing position to start the parsing in the arguments */ - public List parse(final List args, final int startPositionParsing, final boolean haveUnknowArgument) { + public List parse(final List args, final boolean haveUnknowArgument) { List listArgument = new ArrayList<>();// composed of list element boolean notParseNextElement=false; - for (int iii=startPositionParsing; iii