You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no way to definitely say, other than parsing a string, whether a command was not recognized in jline.console.
UnknownCommandException is not public, hence, the best catch you can have is Exception. But then you have to check the string for "unknown" in it. It would be nice to have that public or have a method that helps you determine when a command was not recognized in the registry. Handling an unknown command is probably not a registry specific function but could be owned by the outer layer. To be consistent with parts of jline.console, perhaps the UnknowCommandException needs to be public.
The text was updated successfully, but these errors were encountered:
SystemRegistryImpl can be used: 1) without scripting support and 2) with scripting support (using ConsoleEngine/ScriptEngine implementations). In a latter case UnknowCommandException will be handled internally in SystemRegistryImpl and it is never thrown outside.
When you use SystemRegistryImpl without scripting support you can test whether the command is known as
String line = reader.readLine("prompt> ");
if (systemRegistry.hasCommand(parser.getCommand(line))) {
systemRegistry.execute(line);
}
where systemRegistry and parser are instances of SystemRegistryImpl and DefaultParser.
There is no way to definitely say, other than parsing a string, whether a command was not recognized in jline.console.
UnknownCommandException
is not public, hence, the best catch you can have isException
. But then you have to check the string for "unknown" in it. It would be nice to have that public or have a method that helps you determine when a command was not recognized in the registry. Handling an unknown command is probably not a registry specific function but could be owned by the outer layer. To be consistent with parts of jline.console, perhaps theUnknowCommandException
needs to be public.The text was updated successfully, but these errors were encountered: