Class CommandTailTipWidgets

java.lang.Object
org.jline.shell.widget.CommandTailTipWidgets

public class CommandTailTipWidgets extends Object
Provides real-time command-line suggestions as the user types, using CommandDescription for positional argument hints and option help.

Suggestions are displayed either as inline tail-tips after the cursor, as completer-driven suggestions, or both. A terminal status bar can optionally show detailed argument and option descriptions.

This widget works with the new shell API (CommandDescription, CommandLine, ArgumentDescription) and can be configured with a static map, a dynamic lookup function, or a CommandDispatcher.

Example using a CommandDispatcher:

 CommandTailTipWidgets widgets = new CommandTailTipWidgets(reader, dispatcher, 5);
 widgets.enable();
 

Example using a static map:

 Map<String, CommandDescription> descriptions = Map.of("ls", lsDesc, "cd", cdDesc);
 CommandTailTipWidgets widgets = new CommandTailTipWidgets(reader, descriptions, 5, TipType.COMBINED);
 widgets.enable();
 
Since:
4.0
See Also: