forked from blanu/juicer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grate.hs
28 lines (25 loc) · 832 Bytes
/
grate.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import System.Environment (getArgs)
import Data.List
import Data.List.Split
import Juicer.Freeze
import Juicer.Puree
import Juicer.Blend
main :: IO ()
main = do
args <- getArgs
case args of
(remotename:localname:requestname:[]) -> do
maybeRemote <- metathaw remotename
maybeLocal <- metathaw localname
case (maybeRemote, maybeLocal) of
(Nothing, _) -> return ()
(_, Nothing) -> return ()
(Just remote, Just local) -> grate remote local requestname
otherwise -> putStrLn "grate [remote] [local] [request]"
grate :: Metafeed -> Metafeed -> String -> IO()
grate remote local requestname = do
putStrLn $ show remote
putStrLn $ show local
let request = metadiff remote local
freezerequest request requestname
putStrLn $ show request