Make user prompts work with redirected stdin #1292

Merged
merged 2 commits into from Dec 6, 2015

Conversation

Projects
None yet
2 participants
@Haydabase
Contributor

Haydabase commented Dec 4, 2015

As per issue #1291, the prompt is now implemented with Console.ReadLine() which works with redirected standard input

#1291 Make user prompts work with redirected stdin
The prompt is now implemented with Console.ReadLine() which works with
redirected standard input
@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Dec 4, 2015

Member

Should we clarify the questions, then?

Member

forki commented Dec 4, 2015

Should we clarify the questions, then?

src/Paket.Core/Utils.fs
@@ -280,7 +280,7 @@ let safeGetFromUrl (auth:Auth option, url : string, contentType : string) =
with _ -> return None
}
-let readKey() = System.Console.ReadKey().KeyChar.ToString()
+let readKey() = System.Console.ReadLine().Trim()

This comment has been minimized.

@forki

forki Dec 4, 2015

Member

should be renamed

@forki

forki Dec 4, 2015

Member

should be renamed

This comment has been minimized.

@Haydabase

Haydabase Dec 5, 2015

Contributor

Fair enough, I've renamed to readAnswer

@Haydabase

Haydabase Dec 5, 2015

Contributor

Fair enough, I've renamed to readAnswer

#1291 Rename readKey to readAnswer
readKey was no longer an appropriate name since it now reads a whole
line

forki added a commit that referenced this pull request Dec 6, 2015

Merge pull request #1292 from DavidHayden87/stdin-prompts
Make user prompts work with redirected stdin

@forki forki merged commit cd1ec7b into fsprojects:master Dec 6, 2015

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Haydabase Haydabase deleted the Haydabase:stdin-prompts branch Dec 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment