main = do
    (cfg, leftovers, errors) <- fmap (getOpt RequireOrder getOptOptions) getArgs
    unless (null errors) . error $ unlines errors
    cfg' <- foldl (>>=) (return defaultConfig :: IO WSCatConfig) cfg
    let cfg'' = applyLeftovers cfg' leftovers
    cfgMainFunc cfg'' $ cfg''
main = do
    (cfg, leftovers, errors) <- fmap (getOpt RequireOrder getOptOptions) getArgs
    unless (null errors) . error $ unlines errors
    cfg' <- foldl (>>=) (return defaultConfig :: IO WSCatConfig) cfg
    let cfg'' = applyLeftovers cfg' leftovers
    cfgMainFunc cfg'' $ cfg''
main = do
    (cfg, leftovers, errors) <- fmap (getOpt RequireOrder getOptOptions) getArgs
    unless (null errors) . error $ unlines errors
    cfg' <- foldl (>>=) (return defaultConfig :: IO WSCatConfig) cfg
    let cfg'' = applyLeftovers cfg' leftovers
    cfgMainFunc cfg'' $ cfg''