From bbb369ec76b693b3f83cf1097ced6af029218675 Mon Sep 17 00:00:00 2001 From: Arnaud Bailly Date: Wed, 8 Sep 2021 07:35:48 +0000 Subject: [PATCH] Allow filtering standard input --- hydra-node/exe/log-filter/Main.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hydra-node/exe/log-filter/Main.hs b/hydra-node/exe/log-filter/Main.hs index db4f53ca4a6..d795788d9ef 100644 --- a/hydra-node/exe/log-filter/Main.hs +++ b/hydra-node/exe/log-filter/Main.hs @@ -10,8 +10,9 @@ import System.IO.Error (isEOFError) main :: IO () main = do - [logFile] <- getArgs - withFile logFile ReadMode $ \hdl -> go hdl + getArgs >>= \case + [logFile] -> withFile logFile ReadMode $ \hdl -> go hdl + _ -> go stdin where go hdl = try (LBS.hGetLine hdl) >>= \case