Small library for autocomplete hints in the console applications
var commands = new[]
{
"dir",
"help",
"copy",
"delete"
};
var inputReader = new ConsoleHintedInput(commands.OrderBy(s => s));
var commandLine = inputReader.ReadHintedLine();
//do something with user command
- Autocomplete hints with highlighting of inputed charachters
- Commands history
Following hot keys are supported out-of-box:
Enter
ends read loop and returns user's inputBackspace
removes character before cursorDelete
removes character under cursorTab
completes user's input with active hint (if found)Space
completes user's input (if found) or adds space character to the end of lineUp arrow
select previous command from history if user's input is empty or select previous hint (if possible)Down arrow
select next command from history if user's input is empty or select next hint (if possible)Left arrow
move cursor leftRight arrow
move cursor rightHome
move cursor to the beginning of user's inputEnd
move cursor to the end of user's input
Modify internal switch
in the ReadHintedLine
function to add processing of other keys