packages feed

hydrogen-cli-args 0.10 → 0.11

raw patch · 3 files changed

+12/−4 lines, 3 filesdep ~hydrogen-preludePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: hydrogen-prelude

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -0,0 +1,2 @@+## v0.11+- unrecognized short opts are now kept in argument list
hydrogen-cli-args.cabal view
@@ -1,5 +1,5 @@ name:                 hydrogen-cli-args-version:              0.10+version:              0.11 homepage:             https://scravy.de/hydrogen-cli-args/ synopsis:             Hydrogen Command Line Arguments Parser license:              MIT@@ -20,7 +20,7 @@   build-depends:      base ==4.7.*                       , containers ==0.5.*                       , hydrogen-multimap ==0.1-                      , hydrogen-prelude ==0.10+                      , hydrogen-prelude ==0.11   hs-source-dirs:     src   ghc-options:        -Wall   default-language:   Haskell2010
src/Hydrogen/CliArgs.hs view
@@ -111,11 +111,17 @@                     | shortOpt `elem` shortArgs && not (null xs) && test opt val'                         -> readArgs (MultiMap.insert opt val' args) switches (tail xs)                     | otherwise-                        -> readArgs args (foldr Set.insert switches shortOpts) xs+                        -> readOpts                   where                     val' = head xs                     opt = aliasMap ! shortOpt-                    shortOpts = map (aliasMap !) $ filter (`elem` shortSwitches) optString+                    (recog, nrecog) = partition (`elem` shortSwitches) optString+                    shortOpts = map (aliasMap !) recog+                    readOpts+                      | null nrecog = (args'', switches'', xs'')+                      | otherwise   = (args'', switches'', ('-' : nrecog) : xs'')+                    (args'', switches'', xs'')+                        = readArgs args (foldr Set.insert switches shortOpts) xs                  _ -> readArg