-- | Function to parse commandline Options
parseOpts :: Opts -> OptsList -> [String] -> IO (Opts, [String])
parseOpts defOpts opts argv =
    case getOpt Permute opts argv of
        (o,n,[]  ) -> return (foldl (flip id) defOpts o, n)
        (_,_,errs) -> ioError (userError (concat errs ++ showUsage))

-- | Shows the usage message
parseOpts :: Opts -> OptsList -> [String] -> IO (Opts, [String])
parseOpts defOpts opts argv =
    case getOpt Permute opts argv of
        (o,n,[]  ) -> return (foldl (flip id) defOpts o, n)
        (_,_,errs) -> ioError (userError (concat errs ++ showUsage))

-- | Shows the usage message
parseOpts defOpts opts argv =
    case getOpt Permute opts argv of
        (o,n,[]  ) -> return (foldl (flip id) defOpts o, n)
        (_,_,errs) -> ioError (userError (concat errs ++ showUsage))

-- | Shows the usage message