[DEV] commit all with new insland

This commit is contained in:
Edouard DUPIN 2022-03-20 23:39:36 +01:00
parent 2935b4e474
commit 7dfde94a47
4 changed files with 71 additions and 65 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
/__pycache__/
# Compiled python modules.
*.pyc

View File

@ -1 +1,3 @@
/__pycache__/
/classes/

View File

@ -16,6 +16,10 @@ public class ArgumentManager {
private final PropertiesInterface properties;
private final boolean enableStoreConfig;
public ArgumentManager(final String[] args, final Object tmp) {
this(args, tmp, false);
}
public ArgumentManager(final String[] args, final Object tmp, final boolean enableStoreConfig) {
this.enableStoreConfig = enableStoreConfig;
for (int iii = 0; iii < args.length; iii++) {
@ -30,9 +34,6 @@ public class ArgumentManager {
}
}
public ArgumentManager(final String[] args, final Object tmp) {
this(args, tmp, false);
}
private void configure(final Object tmp) {
boolean endParsing = false;
@ -45,7 +46,7 @@ public class ArgumentManager {
if (value.startsWith("--")) {
String[] elements = value.split("=");
elements[0] = elements[0].substring(2);
Log.warning("find element (--) : " + Arrays.toString(elements));
Log.verbose("find element (--) : " + Arrays.toString(elements));
String parameter = elements[0];
String newValue = null;
if (!this.properties.existParameter(parameter)) {
@ -105,7 +106,7 @@ public class ArgumentManager {
}
this.properties.setParameterAlias(tmp, parameter, newValue);
} else {
Log.warning("find element ( ) : " + value);
Log.verbose("find element ( ) : " + value);
if (this.properties.actions != null && this.properties.actions.exist(value)) {
// Find end of parsing ...
endParsing = true;
@ -145,59 +146,59 @@ public class ArgumentManager {
Log.warning("Rejected executor, " + exec.getName() + " nbParameter=" + exec.getParameterCount() + " require=" + nbParameters);
continue;
}
Log.warning("find executor, " + exec.getName());
Log.verbose("find executor, " + exec.getName());
try {
switch (nbParameters) {
case 0:
exec.invoke(obj);
break;
case 1:
exec.invoke(obj,
exec.invoke(obj, //
localManager.argumentPostConfigure.get(0));
break;
case 2:
exec.invoke(obj,
localManager.argumentPostConfigure.get(0),
exec.invoke(obj, //
localManager.argumentPostConfigure.get(0), //
localManager.argumentPostConfigure.get(1));
break;
case 3:
exec.invoke(obj,
localManager.argumentPostConfigure.get(0),
localManager.argumentPostConfigure.get(1),
exec.invoke(obj, //
localManager.argumentPostConfigure.get(0), //
localManager.argumentPostConfigure.get(1), //
localManager.argumentPostConfigure.get(2));
break;
case 4:
exec.invoke(obj,
localManager.argumentPostConfigure.get(0),
localManager.argumentPostConfigure.get(1),
localManager.argumentPostConfigure.get(2),
exec.invoke(obj, //
localManager.argumentPostConfigure.get(0), //
localManager.argumentPostConfigure.get(1), //
localManager.argumentPostConfigure.get(2), //
localManager.argumentPostConfigure.get(3));
break;
case 5:
exec.invoke(obj,
localManager.argumentPostConfigure.get(0),
localManager.argumentPostConfigure.get(1),
localManager.argumentPostConfigure.get(2),
localManager.argumentPostConfigure.get(3),
exec.invoke(obj, //
localManager.argumentPostConfigure.get(0), //
localManager.argumentPostConfigure.get(1), //
localManager.argumentPostConfigure.get(2), //
localManager.argumentPostConfigure.get(3), //
localManager.argumentPostConfigure.get(4));
break;
case 6:
exec.invoke(obj,
localManager.argumentPostConfigure.get(0),
localManager.argumentPostConfigure.get(1),
localManager.argumentPostConfigure.get(2),
localManager.argumentPostConfigure.get(3),
localManager.argumentPostConfigure.get(4),
exec.invoke(obj, //
localManager.argumentPostConfigure.get(0), //
localManager.argumentPostConfigure.get(1), //
localManager.argumentPostConfigure.get(2), //
localManager.argumentPostConfigure.get(3), //
localManager.argumentPostConfigure.get(4), //
localManager.argumentPostConfigure.get(5));
break;
case 7:
exec.invoke(obj,
localManager.argumentPostConfigure.get(0),
localManager.argumentPostConfigure.get(1),
localManager.argumentPostConfigure.get(2),
localManager.argumentPostConfigure.get(3),
localManager.argumentPostConfigure.get(4),
localManager.argumentPostConfigure.get(5),
exec.invoke(obj, //
localManager.argumentPostConfigure.get(0), //
localManager.argumentPostConfigure.get(1), //
localManager.argumentPostConfigure.get(2), //
localManager.argumentPostConfigure.get(3), //
localManager.argumentPostConfigure.get(4), //
localManager.argumentPostConfigure.get(5), //
localManager.argumentPostConfigure.get(6));
break;
default:
@ -212,18 +213,19 @@ public class ArgumentManager {
}
public void showHelp() {
this.properties.displayHelp();
public List<String> getArgumentDetected() {
return this.argumentPostConfigure;
}
public boolean hasArgumentDetected() {
return this.argumentPostConfigure.size() != 0;
}
public boolean hasDetectedAction() {
return this.actionDetected != null;
}
public boolean hasArgumentDetected() {
return this.argumentPostConfigure.size() != 0;
}
public List<String> getArgumentDetected() {
return this.argumentPostConfigure;
public void showHelp() {
this.properties.displayHelp();
}
}

View File

@ -48,7 +48,7 @@ public class Log {
public static void print(final String data) {
if (PRINT_PRINT) {
Logger.print(LIB_NAME_DRAW, data);
System.out.println(data);
}
}