Ondřej Macháček has posted comments on this change. Change subject: extensions test tool: logger ......................................................................
Patch Set 16: (4 comments) https://gerrit.ovirt.org/#/c/37886/16/backend/manager/extension-tool/src/main/java/org/ovirt/engine/exttool/core/ExtensionsToolExecutor.java File backend/manager/extension-tool/src/main/java/org/ovirt/engine/exttool/core/ExtensionsToolExecutor.java: Line 89: String.format( Line 90: "usage: %s%n%n%s%n%n%s", Line 91: ((String)args.get("__usage__")).replace("@PROGRAM_NAME@", programName), Line 92: (String)args.get("__help__"), Line 93: (String)args.get("__underlinetext__") > why do you get this __help__ and such out of the args and not out of the pa Because I "lost" reference to ParametersParser class once parserArguments is called. So the easiest way how to keep everyything I need from this class is to store it in args as additional variables. Line 94: ) Line 95: ); Line 96: if(args.containsKey("__modules__")) { Line 97: System.out.println( Line 92: (String)args.get("__help__"), Line 93: (String)args.get("__underlinetext__") Line 94: ) Line 95: ); Line 96: if(args.containsKey("__modules__")) { > this again not something I understand.... how did it reach to args? This is actully not needed I can remove it from args and. Line 97: System.out.println( Line 98: String.format("Available modules: %s", args.get("__modules__")) Line 99: ); Line 100: } https://gerrit.ovirt.org/#/c/37886/16/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 13: public String getName(); Line 14: Line 15: public String getDescription(); Line 16: Line 17: public Map<String, Object> getArguments(); > not sure why this is required As I wrote in previous class. This is an way how to access all information from ParametersParser. Line 18: Line 19: public boolean doHelp(); Line 20: Line 21: public void setContext(ExtMap context); Line 21: public void setContext(ExtMap context); Line 22: Line 23: public ExtMap getContext(); Line 24: Line 25: public void parseArguments(List<String> argsList, String prefix) throws Exception; > why do you need the prefix? the module should get all others parameters and asi it wishes? How it could then know what args are wrong and what are correct? if it don't know what prefix use and how the args should be validated? This is just abstraction of calling new ParametersParser(prefix).parse(argsList) Line 26: Line 27: public void run(String action) throws Exception; Line 28: -- 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: 16 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Ondřej Macháček <[email protected]> Gerrit-Reviewer: Alon Bar-Lev <[email protected]> Gerrit-Reviewer: Ondra Machacek <[email protected]> Gerrit-Reviewer: Ondřej Macháček <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: mooli tayer <[email protected]> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
