elharo commented on code in PR #12750:
URL: https://github.com/apache/maven/pull/12750#discussion_r3804093839


##########
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnsh/builtin/BuiltinShellCommandRegistryFactory.java:
##########
@@ -67,6 +68,17 @@ public CommandRegistry 
createShellCommandRegistry(LookupContext context) {
         return new BuiltinShellCommandRegistry(context);
     }
 
+    /**
+     * Reports the exit code of a command invoked from the shell. Commands 
terminate by throwing
+     * {@link InvokerException.ExitException}, and they do so on success as 
well: {@code --help} and
+     * {@code --version} exit with code 0. Only a non-zero code is an error 
worth reporting.
+     */
+    static void reportExitCode(Logger logger, String commandName, int 
exitCode) {
+        if (exitCode != 0) {

Review Comment:
   The method name says it reports an exit code, but it doesn't always do that. 
Rename the method of perhaps move the if block to where this method is invoked. 



##########
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnsh/builtin/BuiltinShellCommandRegistryFactory.java:
##########
@@ -67,6 +68,17 @@ public CommandRegistry 
createShellCommandRegistry(LookupContext context) {
         return new BuiltinShellCommandRegistry(context);
     }
 
+    /**
+     * Reports the exit code of a command invoked from the shell. Commands 
terminate by throwing

Review Comment:
   This doc comment is at least confusing and perhaps wrong. Rewrite. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to