pointful-1.1.0.0: main/Pointful.hs
module Main
where
import System.Environment (getArgs)
import System.IO (hPutStrLn, stderr)
import System.Exit (exitFailure)
import Lambdabot.Pointful (pointful)
printUsage :: IO ()
printUsage = putStrLn "Usage: pointful QUERY"
main :: IO ()
main = do
query <- getArgs
if null query
then printUsage
else case pointful $ unwords query of
(Left err) -> hPutStrLn stderr err >> exitFailure
(Right res) -> putStrLn res