main = do
    prg <- getProgName
    (opts, sigFile) <- fmap (parseArgs $ header prg) getArgs
    when (optHelp opts) $ do
        putStr $ usageInfo (header prg) options
        exitSuccess
    content <- input sigFile
    puids <- collectPuids opts
    let filterOpts = [WithSupertypes | optSupertypes opts] ++
                     [WithSubtypes   | optSubtypes   opts]
    output (optOutFile opts) $
        (if optList opts then intercalate "\n" . listFileFormats else id) $
        filterSigFile filterOpts puids content
main = do
    prg <- getProgName
    (opts, sigFile) <- fmap (parseArgs $ header prg) getArgs
    when (optHelp opts) $ do
        putStr $ usageInfo (header prg) options
        exitSuccess
    content <- input sigFile
    puids <- collectPuids opts
    let filterOpts = [WithSupertypes | optSupertypes opts] ++
                     [WithSubtypes   | optSubtypes   opts]
    output (optOutFile opts) $
        (if optList opts then intercalate "\n" . listFileFormats else id) $
        filterSigFile filterOpts puids content
main = do
    prg <- getProgName
    (opts, sigFile) <- fmap (parseArgs $ header prg) getArgs
    when (optHelp opts) $ do
        putStr $ usageInfo (header prg) options
        exitSuccess
    content <- input sigFile
    puids <- collectPuids opts
    let filterOpts = [WithSupertypes | optSupertypes opts] ++
                     [WithSubtypes   | optSubtypes   opts]
    output (optOutFile opts) $
        (if optList opts then intercalate "\n" . listFileFormats else id) $
        filterSigFile filterOpts puids content