-- ----------------------- Input Arguments -------------------------

processArgs :: [String] -> Either String ProgSettings
processArgs args =
    let (flags, noopts, unrecopts, errs) = getOpt' (ReturnInOrder PFLib) options args
        msgl = checkFlags flags
        f str (l, s) = if null l then str else str ++ "\n" ++ s ++ unlines l
        msg = foldl f ""
              [ (noopts, "non-handled extra arguments encountered ")
              , (unrecopts, "unrecognized flags encountered ")
              , (errs, "")
              , (msgl, "")
              ]
    in if null msg then Right $ getSettings flags else Left msg
processArgs :: [String] -> Either String ProgSettings
processArgs args =
    let (flags, noopts, unrecopts, errs) = getOpt' (ReturnInOrder PFLib) options args
        msgl = checkFlags flags
        f str (l, s) = if null l then str else str ++ "\n" ++ s ++ unlines l
        msg = foldl f ""
              [ (noopts, "non-handled extra arguments encountered ")
              , (unrecopts, "unrecognized flags encountered ")
              , (errs, "")
              , (msgl, "")
              ]
    in if null msg then Right $ getSettings flags else Left msg
processArgs args =
    let (flags, noopts, unrecopts, errs) = getOpt' (ReturnInOrder PFLib) options args
        msgl = checkFlags flags
        f str (l, s) = if null l then str else str ++ "\n" ++ s ++ unlines l
        msg = foldl f ""
              [ (noopts, "non-handled extra arguments encountered ")
              , (unrecopts, "unrecognized flags encountered ")
              , (errs, "")
              , (msgl, "")
              ]
    in if null msg then Right $ getSettings flags else Left msg