2020-04-24 03:48:49 +03:00
|
|
|
module Main where
|
|
|
|
|
2020-04-25 07:28:20 +03:00
|
|
|
import Data.Attoparsec.Text
|
|
|
|
import qualified Data.Text.IO as T
|
2020-05-01 02:35:00 +03:00
|
|
|
import Hie.Cabal.Parser
|
|
|
|
import Hie.Yaml
|
2020-04-25 07:28:20 +03:00
|
|
|
import System.Environment
|
2020-04-24 03:48:49 +03:00
|
|
|
|
|
|
|
main :: IO ()
|
2020-04-25 07:28:20 +03:00
|
|
|
main = do
|
|
|
|
args <- getArgs
|
|
|
|
file <- T.readFile $ head args
|
2020-05-01 00:48:09 +03:00
|
|
|
case parseOnly parseSec file of
|
2020-05-01 02:35:00 +03:00
|
|
|
Right r -> do
|
|
|
|
T.putStr $ cabalHieYaml r
|
|
|
|
T.putStr $ stackHieYaml r
|
2020-04-25 07:28:20 +03:00
|
|
|
_ -> error "Could not parse *.cabal file"
|