Martin Peřina has posted comments on this change. Change subject: uutils: added new cli parser ......................................................................
Patch Set 8: (4 comments) https://gerrit.ovirt.org/#/c/40157/8/backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/cli/parser/ParametersParser.java File backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/cli/parser/ParametersParser.java: Line 43: Line 44: static enum ArgumentType { Line 45: has_argument, Line 46: optional_argument, Line 47: no_argument, > OK, but I can't use MANDATORY, as such name is already used for different p No problem Line 48: } Line 49: Line 50: public ParametersParser(Properties properties, String prefix) { Line 51: this.properties = properties; Line 52: this.prefix = prefix; Line 53: parseProperties(); Line 54: } Line 55: Line 56: public ParametersParser(InputStream resource, String prefix) { > It was removed earlier, but IIRC Mooli wanted that. I will talk to him about it, please remove Line 57: this(loadProperties(resource), prefix); Line 58: } Line 59: Line 60: public Map<String, Object> parse(String... args) { https://gerrit.ovirt.org/#/c/40157/8/backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/cli/parser/ParserArgument.java File backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/cli/parser/ParserArgument.java: Line 1: package org.ovirt.engine.core.uutils.cli.parser; Line 2: Line 3: import java.util.regex.Pattern; Line 4: Line 5: public class ParserArgument { > Hmm, isn't this one of very common name ? :) Yes, but you are in a parser subpackage, so it should be clear what is Argument about. Line 6: Line 7: private String name; Line 8: private String help; Line 9: private String defaultValue; https://gerrit.ovirt.org/#/c/40157/8/backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/cli/parser/Util.java File backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/cli/parser/Util.java: Line 10: import java.util.HashMap; Line 11: import java.util.List; Line 12: import java.util.Map; Line 13: Line 14: public class Util { > Well, this Util implements only one method which is not specific for Argume I can't see its usage outside parser. If this usage is planned, then please move this class outside parser package. As I don't see usage in other parts, if it seems ok for me to move it into uutils package and name it for example StringValueConverter Line 15: Line 16: private static final Map<Class<?>, Class<?>> typeBox = new HashMap<>(); Line 17: static { Line 18: typeBox.put(boolean.class, Boolean.class); -- To view, visit https://gerrit.ovirt.org/40157 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I00042b669e19293641579582223e7ca40717132d Gerrit-PatchSet: 8 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Ondra Machacek <omach...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Martin Peřina <mper...@redhat.com> Gerrit-Reviewer: Mooli Tayer <mta...@redhat.com> Gerrit-Reviewer: Ondra Machacek <omach...@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: mooli tayer <mta...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches