Alon Bar-Lev has posted comments on this change.

Change subject: extensions test tool: logger
......................................................................


Patch Set 14:

(6 comments)

https://gerrit.ovirt.org/#/c/37886/14/backend/manager/extension-tool/src/main/java/org/ovirt/engine/exttool/core/ModuleService.java
File 
backend/manager/extension-tool/src/main/java/org/ovirt/engine/exttool/core/ModuleService.java:

Line 19:     public void setContext(ExtMap context);
Line 20: 
Line 21:     public ExtMap getContext();
Line 22: 
Line 23:     public void parseArguments(String action, List<String> argsList) 
throws Exception;
the action should be parsed by the module itself, it is not the business of the 
core.
Line 24: 
Line 25:     public void run() throws  Exception;
Line 26: 


https://gerrit.ovirt.org/#/c/37886/14/backend/manager/extension-tool/src/main/resources/org/ovirt/engine/exttool/core/arguments.properties
File 
backend/manager/extension-tool/src/main/resources/org/ovirt/engine/exttool/core/arguments.properties:

Line 20: core.arg.help.help = show test tool help
Line 21: core.arg.version.name = version
Line 22: core.arg.version.help = show version of test tool
Line 23: help.underlinetext = You can use this tool to test your extension.
Line 24: help.usage = @EXT_TESTTOOL_PACKAGE_NAME@ [core options] module action 
[action options]
@EXT_TESTTOOL_PACKAGE_NAME@ should be argv[0], always printed

[options] - is also always printed

so constant is:

 argv[0] [options]

the rest is the variable part... in our case:

 help.cmdline.suffix = module [module options]

then a dump of all options.

then the help.underlinetext

right?


https://gerrit.ovirt.org/#/c/37886/14/backend/manager/extension-tool/src/main/resources/org/ovirt/engine/exttool/logger/services/arguments.properties
File 
backend/manager/extension-tool/src/main/resources/org/ovirt/engine/exttool/logger/services/arguments.properties:

just noticed, why is it in services?
Line 1: log-record.arg.logger-name.name = logger-name
Line 2: log-record.arg.logger-name.mandatory = true
Line 3: log-record.arg.logger-name.help = name of logger
Line 4: log-record.arg.logger-name.type = has_argument


Line 18: log-record.arg.level.default = INFO
Line 19: log-record.arg.help.name = help
Line 20: log-record.arg.help.help = show help for logger module
Line 21: help.underlinetext = You can test your logger extension
Line 22: help.usage = @EXT_TESTTOOL_PACKAGE_NAME@ [core options] logger action 
[module options]
here if we have only suffix we set it to logger action [action options]


https://gerrit.ovirt.org/#/c/37886/14/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 268:         sb.append(help.get("usage") + "\n\n");
Line 269:         sb.append("Actions:\n");
Line 270:         for(Map.Entry<String, Map<String, ParserArgument>> usage : 
usages.entrySet()) {
Line 271:             sb.append("\t" + usage.getKey() + "\n");
Line 272:             sb.append("\t\t" + "Options:\n");
please do not use tabs in output, please always use String.format.

also, please avoid multiple additions...

 sb.append(
     String.format(
         (
             "line1\n"
             "line2\n"
         ),
         format1,
         ...
     )
 )
Line 273:             for(Map.Entry<String, ParserArgument> entry : 
usage.getValue().entrySet()) {
Line 274:                 sb.append(
Line 275:                     String.format(
Line 276:                         "\t\t\t--%-30s%-60s\n",


https://gerrit.ovirt.org/#/c/37886/14/backend/manager/modules/uutils/src/main/resources/org/ovirt/engine/core/uutils/cli/parser/defaults.properties
File 
backend/manager/modules/uutils/src/main/resources/org/ovirt/engine/core/uutils/cli/parser/defaults.properties:

Line 4: arg.convert = java.lang.String
Line 5: arg.matcher = .*
Line 6: arg.metavar = STRING
Line 7: arg.multivalue = false
Line 8: help.underlinetext =
usage is missing.


-- 
To view, visit https://gerrit.ovirt.org/37886
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie06113c5d56a49e58d557c851f9ff00b9a9ca409
Gerrit-PatchSet: 14
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ondřej Macháček <machacek.on...@gmail.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Ondra Machacek <omach...@redhat.com>
Gerrit-Reviewer: Ondřej Macháček <machacek.on...@gmail.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