Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/ReadLine/ReadLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ static ReadLine()
public static void ClearHistory() => _history = new List<string>();
public static bool HistoryEnabled { get; set; }
public static IAutoCompleteHandler AutoCompletionHandler { private get; set; }

public static Action<string> WritePrompt { private get; set; } = (prompt) => Console.Write(prompt);

public static string Read(string prompt = "", string @default = "")
{
Console.Write(prompt);
WritePrompt(prompt);
KeyHandler keyHandler = new KeyHandler(new Console2(), _history, AutoCompletionHandler);
string text = GetText(keyHandler);

Expand All @@ -41,7 +42,7 @@ public static string Read(string prompt = "", string @default = "")

public static string ReadPassword(string prompt = "")
{
Console.Write(prompt);
WritePrompt(prompt);
KeyHandler keyHandler = new KeyHandler(new Console2() { PasswordMode = true }, null, null);
return GetText(keyHandler);
}
Expand Down
2 changes: 1 addition & 1 deletion src/ReadLine/ReadLine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyTitle>ReadLine</AssemblyTitle>
<AssemblyDescription>A GNU-Readline like library for .NET/.NET Core</AssemblyDescription>
<AssemblyVersion>2.0.1</AssemblyVersion>
<AssemblyVersion>2.0.0</AssemblyVersion>
<Authors>Toni Solarin-Sodara</Authors>
<TargetFramework>netstandard2.0</TargetFramework>
<DebugType>portable</DebugType>
Expand Down