-
I am following along with this example creating an interactive shell. When this is run and you type in "help," it shows three categories of commands: System, Builtins, and PicocliCommands. My only difference from this example is that instead of containing commands in a nested class, all commands are part of the "Example" class as command functions. A few questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Regarding my first question, when I create my PicocliCommands instance (picocliCommands), I see that I can print picocliCommands.name(), which is PicocliCommands. I assume this is where the heading comes from in the built-in help subcommand. Can you make a setter for this? |
Beta Was this translation helpful? Give feedback.
-
Hi @irinaleo thank you for raising this. The JLine folks were very helpful in providing the integration layer between picocli and JLine, but I confess JLine is not my specialty. I’ll take a look when I get to my PC. |
Beta Was this translation helpful? Give feedback.
-
Until we add a setter for the name (#2031), please subclass the PicocliCommands class in your project and override the
I am seeing this line in the Example application: systemRegistry.setCommandRegistries(builtins, picocliCommands); Omitting the systemRegistry.setCommandRegistries(picocliCommands); // without builtins
Ouch, unfortunately I am out of my depth here... This help usage output is largely generated by JLine. |
Beta Was this translation helpful? Give feedback.
Until we add a setter for the name (#2031), please subclass the PicocliCommands class in your project and override the
name()
method.I am seeing this line in the Example application:
Omitting the
builtins
, and just registering the picocli commands should do the trick. Can you try this?