gnodet commented on code in PR #2117:
URL: https://github.com/apache/maven/pull/2117#discussion_r1967365909


##########
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnsh/builtin/BuiltinShellCommandRegistryFactory.java:
##########
@@ -75,15 +75,14 @@ private BuiltinShellCommandRegistry(LookupContext 
shellContext) {
             this.mavenParser = new MavenParser();
             this.shellEncryptInvoker = new 
EncryptInvoker(shellContext.invokerRequest.lookup(), contextCopier());
             this.encryptParser = new EncryptParser();
-            Set<Command> commands = new 
HashSet<>(EnumSet.allOf(Command.class));
-            Map<Command, String> commandName = new HashMap<>();
-            Map<Command, CommandMethods> commandExecute = new HashMap<>();
-            for (Command c : commands) {
-                commandName.put(c, c.name().toLowerCase());
-            }
-            commandExecute.put(Command.MVN, new CommandMethods(this::mvn, 
this::mvnCompleter));
-            commandExecute.put(Command.MVNENC, new 
CommandMethods(this::mvnenc, this::mvnencCompleter));
-            registerCommands(commandName, commandExecute);
+            Map<String, CommandMethods> commandExecute = new HashMap<>();
+            commandExecute.put("!", new CommandMethods(this::shell, 
this::defaultCompleter));
+            commandExecute.put("cd", new CommandMethods(this::cd, 
this::cdCompleter));
+            commandExecute.put("ls", new CommandMethods(this::ls, 
this::defaultCompleter));

Review Comment:
   Then, I'd remove `ls` and see if we can provide a posix set of commands in a 
separate extension.
   I'd really like a property in `~/.m2/maven.properties` (i.e. a known _maven 
property_) that could be parsed to discover extensions: this could include a 
list of GAvoids which would contain project-less mojos that could be run as 
commands, such as toolbox, etc... 



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