cstamas commented on code in PR #2117:
URL: https://github.com/apache/maven/pull/2117#discussion_r1967383733
##########
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:
Removed `ls`, and yes, we may want to provide some standard extensions. And
yes, that would be useful feat.
--
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]