Alon Bar-Lev has posted comments on this change.

Change subject: uutils: added new cli parser
......................................................................


Patch Set 10:

(3 comments)

just to revisit the idea of args that can be modified...

it simplifies the processing of actions and such, no need to get the others...

 parse(args);
 action = args.remove(0);
 parse(args);

https://gerrit.ovirt.org/#/c/40157/10/backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/cli/parser/ArgumentsParser.java
File 
backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/cli/parser/ArgumentsParser.java:

Line 27:  * <p>
Line 28:  *  name - Name of the argument, <b>Must be declared by developer</b>
Line 29:  *  help - Help to be printed to argument, when user request help to 
be printed (default: empty string)
Line 30:  *  mandatory - true/false declares if argument have to be specified 
or not (default: false)
Line 31:  *  type - one of:
if you do javadoc these should be probably:

 <ul>
 <li>xxx</li>
 <li>xxx</li>
 </ul>
Line 32:  *    has_argument - argument requires value
Line 33:  *    optional_argument - argument could have value
Line 34:  *    no_argument - argument doesn't have value (default)
Line 35:  *  convert - Name of the class that arguments value should be 
converted to (default: java.lang.String)


Line 70:  *    --<prefix>arg.argument2.name
Line 71:  *      <prefix>arg.argument2.help
Line 72:  *
Line 73:  *  $help.footer
Line 74:  * """
I think this should be in <pre>

 <pre>{@code
  bla bla bla
 }</pre>
Line 75:  * </p>
Line 76:  *
Line 77:  * Example:
Line 78:  *  We have program which support two actions - [add, remove]. Both 
actions accepts different arguments and program too.


Line 127:      * Prefix which every argument should use to be considered 
argument.
Line 128:      */
Line 129:     private static final String LONG_PREFIX = "--";
Line 130: 
Line 131:     /**
no need to javadoc private unless you just want to work hard :)
Line 132:      * Stores default values of every argument, if user don't 
override it default from this file will be used.
Line 133:      */
Line 134:     private static final Properties defaultProperties = 
loadProperties(
Line 135:         
ArgumentsParser.class.getResourceAsStream("defaults.properties")


-- 
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: 10
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

Reply via email to