Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (19 sloc) 646 Bytes
module Main where
import OpenAFP
import System.Exit
import Data.Char (isDigit, isAlphaNum)
import Data.List (find)
import qualified Data.ByteString.Char8 as C
main :: IO ()
main = do
args <- getArgs
if null args then error "Usage: afp-tledump file.afp" else do
let (inFile:_) = args
cs <- readAFP inFile
forM_ (filter (~~ _TLE) cs) $ \tle -> do
let Just (fqn:av:_) = tle_Chunks `applyToChunk` tle
Just key = t_fqn `applyToChunk` fqn
Just val = t_av `applyToChunk` av
putStr (filter (/= '\x00') $ fromAStr key)
putStr "="
putStrLn (filter (/= '\x00') $ fromAStr val)