- Just (rest,action) ->
- case processOneArg action rest arg args of
- Left err -> process spec args spare (err:errs)
- Right (action,rest) -> action >> process spec rest spare errs
- Nothing -> process spec args (dash_arg:spare) errs
-
- process spec (arg:args) spare errs =
- process spec args (arg:spare) errs
-
-
-processOneArg :: OptKind m -> String -> String -> [String]
- -> Either String (m (), [String])
+ Just (rest, action, deprecated) ->
+ let warns' = case deprecated of
+ Deprecated warning ->
+ L loc ("Warning: " ++ dash_arg ++ " is deprecated: " ++ warning) : warns
+ DeprecatedFullText warning ->
+ L loc ("Warning: " ++ warning) : warns
+ Supported -> warns
+ in case processOneArg action rest arg args of
+ Left err -> process spec args spare (L loc err : errs) warns'
+ Right (action,rest) -> do action
+ process spec rest spare errs warns'
+ Nothing -> process spec args (locArg : spare) errs warns
+
+ process spec (arg : args) spare errs warns =
+ process spec args (arg : spare) errs warns
+
+
+processOneArg :: OptKind m -> String -> String -> [Located String]
+ -> Either String (m (), [Located String])