read stdin
This commit is contained in:
parent
00433a26e8
commit
fd8356aa1b
|
@ -58,7 +58,7 @@ indent: parse then pretty print sql
|
||||||
> getInput :: [String] -> IO (FilePath,String)
|
> getInput :: [String] -> IO (FilePath,String)
|
||||||
> getInput as =
|
> getInput as =
|
||||||
> case as of
|
> case as of
|
||||||
> ["-"] -> error "read stdin"
|
> ["-"] -> ("-",) <$> getContents
|
||||||
> ("-c":as') -> return ("-", unwords as')
|
> ("-c":as') -> return ("-", unwords as')
|
||||||
> [filename] -> (filename,) <$> readFile filename
|
> [filename] -> (filename,) <$> readFile filename
|
||||||
> _ -> showHelp (Just "arguments not recognised") >> error ""
|
> _ -> showHelp (Just "arguments not recognised") >> error ""
|
||||||
|
|
Loading…
Reference in a new issue