cstamas commented on code in PR #2117:
URL: https://github.com/apache/maven/pull/2117#discussion_r1967332588
##########
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:
I was intentionally limiting "command set" to "navigation" only. Keep core
simple: can run mvn/mvnenc (like in real shell, provided by distro) and you can
navigate your workdir. All the rest is not in maven core anyway, and IMO should
be provided like by some extensions IMO. I think we don't want a super-uber
generic script/shell here, just leave the door open for whoever wants it, be
able to do it.
--
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]