Skip to content

Commit

Permalink
Allow filtering standard input
Browse files Browse the repository at this point in the history
  • Loading branch information
abailly-iohk committed Sep 24, 2021
1 parent 79da78c commit bbb369e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hydra-node/exe/log-filter/Main.hs
Expand Up @@ -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
Expand Down

0 comments on commit bbb369e

Please sign in to comment.