Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/ScriptCs.Contracts/IConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public interface IConsole

void WriteLine(string value);

string ReadLine();
string ReadLine(string prompt);

void Clear();

Expand Down
3 changes: 1 addition & 2 deletions src/ScriptCs.Core/ReplCommands/ExitCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public object Execute(IRepl repl, object[] args)

while (!responseIsValid)
{
_console.Write("Are you sure you wish to exit? (y/n): ");
response = (_console.ReadLine() ?? string.Empty).ToLowerInvariant();
response = (_console.ReadLine("Are you sure you wish to exit? (y/n):") ?? string.Empty).ToLowerInvariant();
responseIsValid = response == "y" || response == "n";
}

Expand Down
4 changes: 2 additions & 2 deletions src/ScriptCs.Hosting/FileConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public void WriteLine(string value)
this.AppendLine(value);
}

public string ReadLine()
public string ReadLine(string prompt)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is there prompt if it's not being used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used.
On Mon, Nov 9, 2015 at 7:10 AM Filip W notifications@github.com wrote:

In src/ScriptCs.Hosting/FileConsole.cs
#1119 (comment):

@@ -35,9 +35,9 @@ public void WriteLine(string value)
this.AppendLine(value);
}

  •    public string ReadLine()
    
  •    public string ReadLine(string prompt)
    

why is there prompt if it's not being used?


Reply to this email directly or view it on GitHub
https://github.com/scriptcs/scriptcs/pull/1119/files#r44284665.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the whole method is

        public string ReadLine(string prompt)
        {
            var line = _innerConsole.ReadLine("");
            this.AppendLine(line);
            return line;
        }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just not used in the FileConsole.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah now i see, ok!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, it is part of the general interface
On Mon, Nov 9, 2015 at 7:51 AM Kristian Hellang notifications@github.com
wrote:

In src/ScriptCs.Hosting/FileConsole.cs
#1119 (comment):

@@ -35,9 +35,9 @@ public void WriteLine(string value)
this.AppendLine(value);
}

  •    public string ReadLine()
    
  •    public string ReadLine(string prompt)
    

It's just not used in the FileConsole.


Reply to this email directly or view it on GitHub
https://github.com/scriptcs/scriptcs/pull/1119/files#r44290238.

{
var line = _innerConsole.ReadLine();
var line = _innerConsole.ReadLine("");
this.AppendLine(line);
return line;
}
Expand Down
Loading