1
Fork 0
simple-sql-parser/tools/PrettyIt.lhs

18 lines
457 B
Plaintext
Raw Normal View History

2013-12-14 00:14:23 +01:00
> import System.Environment
> import Language.SQL.SimpleSQL.Pretty
> import Language.SQL.SimpleSQL.Parser
> import Data.List
> main :: IO ()
> main = do
> args <- getArgs
> case args of
> [f] -> do
> src <- readFile f
2013-12-14 09:55:44 +01:00
> either (error . peFormattedError)
> (putStrLn . prettyQueryExprs)
> $ parseQueryExprs f Nothing src
> _ -> error "please pass filename to prettify"