Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Latency/readline
Browse files Browse the repository at this point in the history
  • Loading branch information
Latency committed Dec 31, 2017
2 parents d2d044c + 41d6a29 commit 180d212
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ReadLine/ReadLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static ReadLine()
public static List<string> GetHistory() => _history;
public static void ClearHistory() => _history = new List<string>();

public static string Read(string prompt = "", string defaultInput = "")
public static string Read(string prompt = "", string defaultInput = "", bool? enableHistory = null)
{
Console.Write(prompt);

Expand All @@ -42,7 +42,7 @@ public static string Read(string prompt = "", string defaultInput = "")
var text = _keyHandler.Text;
if (string.IsNullOrWhiteSpace(text) && !string.IsNullOrWhiteSpace(defaultInput))
text = defaultInput;
else
else if (useHistory)
_history.Add(text);

return text;
Expand Down

0 comments on commit 180d212

Please sign in to comment.