-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow inspection of Builtins commands #480
Comments
Additionally, perhaps it would be nice to encapsulate the shared methods of import org.jline.builtins.Completers;
import org.jline.builtins.Widgets;
import java.util.Map;
import java.util.Set;
public interface ICommandRegistry {
/**
* Returns the command names known by this registry.
* @return the set of known command names, excluding aliases
*/
Set<String> commandNames();
/**
* Returns a map of alias-to-command names known by this registry.
* @return a map with alias keys and command name values
*/
Map<String, String> commandAliases();
/**
* Returns whether a command with the specified name is known to this registry.
* @param command the command name to test
* @return true if the specified command is registered
*/
boolean hasCommand(String command);
/**
* Returns a {@code SystemCompleter} that can provide detailed completion
* information for all registered commands.
*
* @return a SystemCompleter that can provide command completion for all registered commands
*/
Completers.SystemCompleter compileCompleters();
/**
* Returns a command description for use in the JLine Widgets framework.
* @param command name of the command whose description to return
* @return command description for JLine TailTipWidgets to be displayed
* in the terminal status bar.
*/
Widgets.CmdDesc commandDescription(String command);
} Thoughts? |
with no additional cost as the command help is already need to be parsed for completers. Method Example: |
That sounds good. What do you think of the |
Sure I like the idea of List<String> commandInfo(String command)
String help(String command) So in JLine can be implemented a class that have methods;
Having a |
Thanks to @mattirn's remkop/picocli#888 PR,
picocli-shell-jline3
now uses JLine 3.13.2 and can integrate nicely with the new TailTipWidgets.To allow even better integration, it would be nice if an application can query the
Builtins
class to get a (read-only) set of command names and a (read-only) map of command name aliases.At the moment, the
Builtins
commands and the picocli-based commands do not know about each other, so for example, if I run thepicocli.shell.jline3.example.Example
class inpicocli-shell-jline3
, and hit<TAB>
at the prompt, I see a list of both built-in and picocli-based commands:Then, when I type
help
(a picocli command), that command can only list up the picocli-based commands. I would like to improve on this, but for that I need to be able to queryBuiltins
.The text was updated successfully, but these errors were encountered: