getOpts :: IO Opts
getOpts = do
    xs <- getArgs
    return $ reduce (Opts [] "a.sh") xs
  where
    reduce opts ("-o" : o : xs) = reduce (opts { output = o }) xs
    reduce opts (i : xs)        = reduce (opts { inputs = i : inputs opts }) xs
    reduce opts []              = opts
getOpts :: IO Opts
getOpts = do
    xs <- getArgs
    return $ reduce (Opts [] "a.sh") xs
  where
    reduce opts ("-o" : o : xs) = reduce (opts { output = o }) xs
    reduce opts (i : xs)        = reduce (opts { inputs = i : inputs opts }) xs
    reduce opts []              = opts
getOpts = do
    xs <- getArgs
    return $ reduce (Opts [] "a.sh") xs
  where
    reduce opts ("-o" : o : xs) = reduce (opts { output = o }) xs
    reduce opts (i : xs)        = reduce (opts { inputs = i : inputs opts }) xs
    reduce opts []              = opts