packages feed

cmdargs 0.10.5 → 0.10.6

raw patch · 4 files changed

+24/−9 lines, 4 files

Files

System/Console/CmdArgs/Implicit/Local.hs view
@@ -116,7 +116,9 @@ mode_ :: Capture Ann -> [Mode_] mode_ (Ann Ignore _) = [] mode_ (Ann a b) = map (modeAnn a) $ mode_ b-mode_ o@(Ctor x ys) = [withMode def{modeFlags_=concat $ zipWith flag_ (fields x) ys} $ \x -> x{modeValue=embed $ fromCapture o}]+mode_ o@(Ctor x ys) = [withMode def{modeFlags_=flgs} $ \x -> x{modeValue=embed $ fixup $ fromCapture o}]+    where flgs = concat $ zipWith flag_ (fields x) ys+          fixup x = foldl (\x (Fixup f) -> f x) x $ map flagFixup flgs mode_ x = err "mode" $ show x  
System/Console/CmdArgs/Implicit/UI.hs view
@@ -90,6 +90,8 @@  -- | Flag: \"Put non-flag arguments here.\" --+--   All argument flags not captured by 'argPos' are returned by 'args'.+-- -- > {hello = def &= args} args :: Ann args = FlagArgs
System/Console/CmdArgs/Test/Implicit/Tests.hs view
@@ -348,16 +348,27 @@     ["a","b","c"] === Test20 (Test20A ["a","b","c"])  +-- #626, don't reverse values too much++newtype Test21A = Test21A [String] deriving (Eq,Show,Data,Typeable)+data Test21 = Test21 {test21A :: Test21A, test21B :: [String], test21C :: [Int]} deriving (Eq,Show,Data,Typeable)++mode21 = cmdArgsMode $ Test21 (Test21A ["a","b","c"]) ["A","B","C"] [1,2,3]++test21 = do+    let Tester{..} = tester "Test21" mode21+    [] === Test21 (Test21A ["a","b","c"]) ["A","B","C"] [1,2,3]++ -- For some reason, these must be at the end, otherwise the Template Haskell -- stage restriction kicks in.  test = test1 >> test2 >> test3 >> test4 >> test5 >> test6 >> test7 >> test8 >> test9 >> test10 >>-       test11 >> test12 >> test13 >> test14 >> test15 >> test16 >> test18 >> test19 >> test20+       test11 >> test12 >> test13 >> test14 >> test15 >> test16 >> test18 >> test19 >> test20 >>+       test21 demos = zipWith f [1..]         [toDemo mode1, toDemo mode2, toDemo mode3, toDemo mode4, toDemo mode5, toDemo mode6         ,toDemo mode7, toDemo mode8, toDemo mode9, toDemo mode10, toDemo mode11, toDemo mode12         ,toDemo mode13, toDemo mode14, toDemo mode15, toDemo mode16, toDemo mode17, toDemo mode18-        ,toDemo mode19, toDemo mode20]+        ,toDemo mode19, toDemo mode20, toDemo mode21]     where f i x = x{modeHelp = "Testing various corner cases (" ++ show i ++ ")"}--
cmdargs.cabal view
@@ -1,7 +1,7 @@ cabal-version:      >= 1.6 build-type:         Simple name:               cmdargs-version:            0.10.5+version:            0.10.6 license:            BSD3 license-file:       LICENSE category:           Console@@ -29,13 +29,13 @@     For a general reference on what command line flags are commonly used,     see <http://www.faqs.org/docs/artu/ch10s05.html>. homepage:           http://community.haskell.org/~ndm/cmdargs/-stability:          Beta+tested-with:        GHC==7.6.3, GHC==7.4.2, GHC==7.2.2 extra-source-files:     cmdargs.htm  source-repository head-    type:     darcs-    location: http://community.haskell.org/~ndm/darcs/cmdargs/+    type:     git+    location: https://github.com/ndmitchell/cmdargs.git  flag testprog     default: False