cmdargs 0.10.21 → 0.10.22
raw patch · 9 files changed
+22/−20 lines, 9 filesdep ~basesetup-changedPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base
API changes (from Hackage documentation)
- System.Console.CmdArgs.Default: instance System.Console.CmdArgs.Default.Default GHC.Integer.Type.Integer
+ System.Console.CmdArgs.Default: instance System.Console.CmdArgs.Default.Default GHC.Num.Integer.Integer
Files
- CHANGES.txt +2/−0
- Data/Generics/Any/Prelude.hs +3/−1
- LICENSE +1/−1
- README.md +9/−9
- Setup.hs +0/−2
- System/Console/CmdArgs/Explicit.hs +1/−1
- System/Console/CmdArgs/Explicit/Process.hs +1/−1
- System/Console/CmdArgs/Test/SplitJoin.hs +1/−1
- cmdargs.cabal +4/−4
CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for CmdArgs +0.10.22, released 2023-03-13+ #68, support GHC 9.6 0.10.21, released 2021-02-14 Handle GHC 9.0 optimisations Remove support for GHC 7.4 to 7.8
Data/Generics/Any/Prelude.hs view
@@ -46,7 +46,9 @@ isString x = typeName x == "[Char]"-isList x = typeShell x == "[]"+-- GHC 9.6 changes from [] to List, so accept either+isList x = ts == "[]" || ts == "List"+ where ts = typeShell x isMaybe x = typeShell x == "Maybe" isTuple x = isJust $ readTupleType $ typeShell x
LICENSE view
@@ -1,4 +1,4 @@-Copyright Neil Mitchell 2009-2021.+Copyright Neil Mitchell 2009-2023. All rights reserved. Redistribution and use in source and binary forms, with or without
README.md view
@@ -1,4 +1,4 @@-# CmdArgs: Easy Command Line Processing [](https://hackage.haskell.org/package/cmdargs) [](https://www.stackage.org/package/cmdargs) [](https://github.com/ndmitchell/cmdargs/actions)+# CmdArgs: Easy Command Line Processing [](https://hackage.haskell.org/package/cmdargs) [](https://www.stackage.org/package/cmdargs) [](https://github.com/ndmitchell/cmdargs/actions) CmdArgs is a Haskell library for defining command line parsers. The two features that make it a better choice than the standard [getopt library](http://haskell.org/ghc/docs/latest/html/libraries/base/System-Console-GetOpt.html) are: @@ -16,10 +16,10 @@ ``` Despite being very concise, this processor is already fairly well featured: - $ runhaskell Sample.hs --hello=world+ $ runghc Sample.hs --hello=world Sample {hello = "world"} - $ runhaskell Sample.hs --help+ $ runghc Sample.hs --help Sample v1, (C) Neil Mitchell 2009 sample [FLAG]@@ -67,13 +67,13 @@ Now we have a reasonably functional command line argument processor. Some sample interactions are: - $ runhaskell Sample.hs --hello=world+ $ runghc Sample.hs --hello=world Sample {hello = "world"} - $ runhaskell Sample.hs --version+ $ runghc Sample.hs --version The sample program - $ runhaskell Sample.hs --help+ $ runghc Sample.hs --help The sample program sample [OPTIONS]@@ -116,13 +116,13 @@ ``` Compared to the first example, we now have multiple constructors, and a sample value for each constructor is passed to `cmdArgs`. Some sample interactions with this command line are: - $ runhaskell Sample.hs hello --whom=world+ $ runghc Sample.hs hello --whom=world Hello {whom = "world"} - $ runhaskell Sample.hs goodbye+ $ runghc Sample.hs goodbye Goodbye - $ runhaskell Sample.hs --help+ $ runghc Sample.hs --help The sample program sample [OPTIONS]
Setup.hs view
@@ -1,4 +1,2 @@-#! /usr/bin/runhaskell- import Distribution.Simple main = defaultMain
System/Console/CmdArgs/Explicit.hs view
@@ -173,7 +173,7 @@ Right (a,b) -> Right $ f a b v format :: String -> Either String (HelpFormat,TextFormat)- format xs = foldl (\acc x -> either Left (f x) acc) (Right def) (sep xs)+ format xs = foldl (\acc x -> f x =<< acc) (Right def) (sep xs) where sep = words . map (\x -> if x `elem` ":," then ' ' else toLower x) f x (a,b) = case x of
System/Console/CmdArgs/Explicit/Process.hs view
@@ -23,7 +23,7 @@ | null (fst $ modeArgs m) && isNothing (snd $ modeArgs m) && args /= [] && not (null $ modeModes m) && not ("-" `isPrefixOf` concat args) -> Left $ missing "mode" $ concatMap modeNames $ modeModes m- | otherwise -> either Left (modeCheck m) $ processFlags m (modeValue m) args+ | otherwise -> modeCheck m =<< processFlags m (modeValue m) args where (find,a,as) = case args of [] -> (NotFound,"",[])
System/Console/CmdArgs/Test/SplitJoin.hs view
@@ -28,7 +28,7 @@ writeFile src "import System.Environment\nmain = print =<< getArgs\n" quickCheckWith stdArgs{chatty=False} $ \(CmdLine x) -> unsafePerformIO $ do putStr $ ",(,) " ++ (show x) ++ " "- system $ "runhaskell \"" ++ src ++ "\" " ++ x+ system $ "runghc \"" ++ src ++ "\" " ++ x return True
cmdargs.cabal view
@@ -1,13 +1,13 @@-cabal-version: >= 1.18+cabal-version: 1.18 build-type: Simple name: cmdargs-version: 0.10.21+version: 0.10.22 license: BSD3 license-file: LICENSE category: Console author: Neil Mitchell <ndmitchell@gmail.com> maintainer: Neil Mitchell <ndmitchell@gmail.com>-copyright: Neil Mitchell 2009-2021+copyright: Neil Mitchell 2009-2023 synopsis: Command line argument processing description: This library provides an easy way to define command line parsers. Most users@@ -33,7 +33,7 @@ extra-doc-files: README.md CHANGES.txt-tested-with: GHC==9.0, GHC==8.10, GHC==8.8, GHC==8.6, GHC==8.4, GHC==8.2, GHC==8.0+tested-with: GHC==9.2, GHC==9.0, GHC==8.10, GHC==8.8, GHC==8.6, GHC==8.4, GHC==8.2, GHC==8.0 source-repository head type: git