summaryrefslogtreecommitdiff
path: root/pp/pp.hs
blob: 0924b6bbfb81e29d97ca6b4cb441cdfc5803f4ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Main (main) where

import Data.BEncode
import qualified Data.ByteString as B
import System.IO
import System.Environment

main :: IO ()
main = do
  path : _ <- getArgs
  content  <- B.readFile path
  case decode content of
    Left e -> hPutStrLn stderr e
    Right be -> printPretty be