Skip to content

Commit

Permalink
CAMEL-21611: camel-jbang - Shell to use Camel as group name
Browse files Browse the repository at this point in the history
  • Loading branch information
davsclaus committed Jan 11, 2025
1 parent 9710edc commit 522fffe
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,22 @@ public Shell(CamelJBangMain main) {
public Integer doCall() throws Exception {
Supplier<Path> workDir = () -> Paths.get(System.getProperty("user.dir"));
// set up JLine built-in commands
Builtins builtins = new Builtins(workDir, new ConfigurationPath(workDir.get(), workDir.get()), null);
Builtins builtins = new Builtins(workDir, new ConfigurationPath(workDir.get(), workDir.get()), null) {
@Override
public String name() {
return "built-in";
}
};

PicocliCommands.PicocliCommandsFactory factory = new PicocliCommands.PicocliCommandsFactory();
PicocliCommands picocliCommands = new PicocliCommands(CamelJBangMain.getCommandLine());
PicocliCommands commands = new PicocliCommands(CamelJBangMain.getCommandLine());
commands.name("Camel");

Parser parser = new DefaultParser();
try (Terminal terminal = TerminalBuilder.builder().build()) {
SystemRegistry systemRegistry = new SystemRegistryImpl(parser, terminal, workDir, null);
systemRegistry.setCommandRegistries(builtins, picocliCommands);
systemRegistry.register("help", picocliCommands);
systemRegistry.setCommandRegistries(builtins, commands);
systemRegistry.register("help", commands);

LineReader reader = LineReaderBuilder.builder()
.terminal(terminal)
Expand Down Expand Up @@ -95,7 +101,6 @@ public Integer doCall() throws Exception {
systemRegistry.trace(e);
}
}

}
return 0;
}
Expand Down

0 comments on commit 522fffe

Please sign in to comment.