[ 
https://issues.apache.org/jira/browse/ARTEMIS-4372?focusedWorklogId=873866&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-873866
 ]

ASF GitHub Bot logged work on ARTEMIS-4372:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 31/Jul/23 17:02
            Start Date: 31/Jul/23 17:02
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on code in PR #4565:
URL: https://github.com/apache/activemq-artemis/pull/4565#discussion_r1279627523


##########
artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java:
##########
@@ -194,68 +191,140 @@ public static Object execute(boolean inputEnabled, 
boolean useSystemOut, File ar
     * Useful on test cases
     */
    private static Object internalExecute(File artemisHome, File 
artemisInstance, File etcFolder, String[] args) throws Exception {
-      return internalExecute(artemisHome, artemisInstance, etcFolder, args, 
ActionContext.system());
+      return internalExecute(artemisHome, artemisInstance, etcFolder, args, 
new ActionContext());
    }
 
    public static Object internalExecute(File artemisHome, File 
artemisInstance, File etcFolder, String[] args, ActionContext context) throws 
Exception {
-      Action action = builder(artemisInstance).build().parse(args);
-      action.setHomeValues(artemisHome, artemisInstance, etcFolder);
+      boolean isInstance = artemisInstance != null || 
System.getProperty("artemis.instance") != null;
+      CommandLine commandLine = buildCommand(isInstance, !isInstance);
+
+      Object userObject = parseAction(commandLine, args);
+
+      // Pico shouldn't allow generating a commandLine without an userObject.
+      // the following assert "should" never happen
+      assert userObject != null;

Review Comment:
   this is never supposed to happen. 
   Only chance userObject is null is if you set the userObject wrongly during 
development. and picocli actually validate that already.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 873866)
    Time Spent: 6h 20m  (was: 6h 10m)

> Move CLI framework to picocli and implement auto-complete
> ---------------------------------------------------------
>
>                 Key: ARTEMIS-4372
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4372
>             Project: ActiveMQ Artemis
>          Issue Type: New Feature
>            Reporter: Clebert Suconic
>            Assignee: Clebert Suconic
>            Priority: Major
>             Fix For: 2.31.0
>
>          Time Spent: 6h 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to