summaryrefslogtreecommitdiff
path: root/Test/DumpMessages.hs
blob: b7e5d6721e47288154fc2d4d1e029c5fc13c91dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Main where

import System.Environment (getArgs)
import Control.Monad (forM_)

import Bustle.Loader.Pcap (readPcap)

main = do
    args <- getArgs
    let file = case args of
            x:_ -> x
            _   -> error "gimme a filename"
    (Right (warnings, messages)) <- readPcap file
    forM_ (zip [1..] messages) $ \(i, message) ->
        putStrLn $ show i ++ ": " ++ show message