Skip to content
Snippets Groups Projects
Commit f183de56 authored by Iustin Pop's avatar Iustin Pop
Browse files

Allow hail to read data from stdin


This patch makes hail treat '-' as denoting stdin, per the usual Unix
convention. This will help with testing.

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 19cff311
No related branches found
No related tags found
No related merge requests found
......@@ -347,7 +347,9 @@ processRequest request =
-- | Reads the request from the data file(s).
readRequest :: FilePath -> IO Request
readRequest fp = do
input_data <- readFile fp
input_data <- case fp of
"-" -> getContents
_ -> readFile fp
case parseData input_data of
Bad err -> do
hPutStrLn stderr $ "Error: " ++ err
......
......@@ -24,6 +24,9 @@ state and the request details, and output (on stdout) a JSON-formatted
response. In case of critical failures, the error message is printed
on stderr and the exit code is changed to show failure.
If the input file name is ``-`` (a single minus sign), then the request
data will be read from *stdin*.
ALGORITHM
~~~~~~~~~
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment