packages feed

cli-arguments 0.6.0.0 → 0.7.0.0

raw patch · 8 files changed

+49/−26 lines, 8 filesdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -40,3 +40,8 @@ functionality. Please, use the CLI.Arguments.Parsing module as logic and  consistent one. +## 0.7.0.0 -- 2023-01-30++* Seventh version. Switched to NoImplicitPrelude extension. Some documentation improvements. Changed+the dependency boundaries.+
CLI/Arguments.hs view
@@ -1,22 +1,28 @@ {-# OPTIONS_HADDOCK show-extensions #-}+{-# LANGUAGE NoImplicitPrelude #-}  -- | -- Module      :  CLI.Arguments--- Copyright   :  (c) OleksandrZhabenko 2021-2022+-- Copyright   :  (c) OleksandrZhabenko 2021-2023 -- License     :  MIT -- Stability   :  Experimental--- Maintainer  :  olexandr543@yahoo.com+-- Maintainer  :  oleksandr.zhabenko@yahoo.com -- -- A library to process command line arguments in some more convenient way.  module CLI.Arguments where  import Data.Monoid (mappend)+import GHC.Base+import Text.Show+import GHC.List +-- | Data to encode the possible cli-arguments of some logics below. The arguments are separated+-- by the spaces characters one from another. data Arguments =-  A String-  | B GQtyArgs Delimiter [String]-  | C Delimiter [String]+  A String -- ^ If for encoding of the argument just one 'String' is used without spaces.+  | B GQtyArgs Delimiter [String] -- ^ If there is a certain quantity of consequent arguments that indicates the one semantical value.+  | C Delimiter [String] -- ^ If the quantity of the consequent arguments that forms a semantic value is not known, but they are enclosed by the delimiter or its modification.       deriving Eq  type Args = [Arguments]
CLI/Arguments/Arr.hs view
@@ -1,18 +1,22 @@ {-# OPTIONS_HADDOCK show-extensions #-}+{-# LANGUAGE NoImplicitPrelude #-}  -- | -- Module      :  CLI.Arguments.Arr--- Copyright   :  (c) OleksandrZhabenko 2021-2022+-- Copyright   :  (c) OleksandrZhabenko 2021-2023 -- License     :  MIT -- Stability   :  Experimental--- Maintainer  :  olexandr543@yahoo.com+-- Maintainer  :  oleksandr.zhabenko@yahoo.com -- -- A library to process command line arguments in some more convenient way.  module CLI.Arguments.Arr where +import GHC.Base+import Data.Tuple import GHC.Arr-import Data.List (sortBy)+import GHC.List (length)+import GHC.Num ((-)) import CLI.Arguments import CLI.Arguments.Parsing import CLI.Arguments.Sorted
CLI/Arguments/Get.hs view
@@ -1,16 +1,19 @@ {-# OPTIONS_HADDOCK show-extensions #-}+{-# LANGUAGE NoImplicitPrelude #-}  -- | -- Module      :  CLI.Arguments.Get--- Copyright   :  (c) OleksandrZhabenko 2022+-- Copyright   :  (c) OleksandrZhabenko 2022-2023 -- License     :  MIT -- Stability   :  Experimental--- Maintainer  :  olexandr543@yahoo.com+-- Maintainer  :  oleksandr.zhabenko@yahoo.com -- -- A library to process command line arguments in some more convenient way.  module CLI.Arguments.Get where +import GHC.Base+import GHC.List (filter, null, elem) import Data.Maybe (fromJust) import qualified Data.Foldable as F import CLI.Arguments
CLI/Arguments/Parsing.hs view
@@ -1,20 +1,22 @@ {-# OPTIONS_HADDOCK show-extensions #-}+{-# LANGUAGE NoImplicitPrelude #-}  -- | -- Module      :  CLI.Arguments.Parsing--- Copyright   :  (c) OleksandrZhabenko 2022+-- Copyright   :  (c) OleksandrZhabenko 2022-2023 -- License     :  MIT -- Stability   :  Experimental--- Maintainer  :  olexandr543@yahoo.com+-- Maintainer  :  oleksandr.zhabenko@yahoo.com -- -- A library to process command line arguments in some more convenient way.  module CLI.Arguments.Parsing where +import GHC.Base+import GHC.List import Data.Monoid (mappend) import Data.Maybe (fromJust) import GHC.Arr-import Data.List (sortBy) import qualified Data.Foldable as F import CLI.Arguments 
CLI/Arguments/Sorted.hs view
@@ -1,16 +1,19 @@ {-# OPTIONS_HADDOCK show-extensions #-}+{-# LANGUAGE NoImplicitPrelude #-}  -- | -- Module      :  CLI.Arguments.Sorted--- Copyright   :  (c) OleksandrZhabenko 2021-2022+-- Copyright   :  (c) OleksandrZhabenko 2021-2023 -- License     :  MIT -- Stability   :  Experimental--- Maintainer  :  olexandr543@yahoo.com+-- Maintainer  :  oleksandr.zhabenko@yahoo.com -- -- A library to process command line arguments in some more convenient way.  module CLI.Arguments.Sorted where +import GHC.Base+import Data.Tuple (fst) import Data.Monoid (mappend) import Data.Maybe (fromJust) import Data.List (sortBy)@@ -19,7 +22,7 @@  takeArgsSortedBy   :: (Arguments -> Bool) -- ^ A predicate to check which 'Arguments' must be kept in the result.-  -> (Arguments -> Arguments -> Ordering) -- ^ A 'compare'-like implementation for 'Arguments'. If needed you can implement your own 'Ord' instance for 'Arguments' and use it here. Here can be partial, just for 'C's.+  -> (Arguments -> Arguments -> Ordering) -- ^ A 'compare'-like implementation for 'Arguments'. If needed you can implement your own 'Ord' instance for 'Arguments' and use it here. Here it can be partial, just for 'C's.   -> CLSpecifications   -> [String]   -> Args@@ -29,7 +32,7 @@ takeArgs1SortedBy   :: FirstChars -- ^ A pair of the first characters of the starting group delimiter (the same for all 'String's in the all 'CLSpecifications') and the probable its modification (the first character of the last delimiter).   -> (Arguments -> Bool) -- ^ A predicate to check which 'Arguments' must be kept in the result.-  -> (Arguments -> Arguments -> Ordering) -- ^ A 'compare'-like implementation for 'Arguments'. If needed you can implement your own 'Ord' instance for 'Arguments' and use it here. Here can be partial, just for 'C's.+  -> (Arguments -> Arguments -> Ordering) -- ^ A 'compare'-like implementation for 'Arguments'. If needed you can implement your own 'Ord' instance for 'Arguments' and use it here. Here it can be partial, just for 'C's.   -> CLSpecifications   -> [String]   -> Args@@ -37,7 +40,7 @@ {-# INLINABLE takeArgs1SortedBy #-}  takeCsSortedBy-  :: (Arguments -> Arguments -> Ordering) -- ^ A 'compare'-like implementation for 'Arguments'. If needed you can implement your own 'Ord' instance for 'Arguments' and use it here. Here can be partial, just for 'C's.+  :: (Arguments -> Arguments -> Ordering) -- ^ A 'compare'-like implementation for 'Arguments'. If needed you can implement your own 'Ord' instance for 'Arguments' and use it here. Here it can be partial, just for 'C's.   -> CLSpecifications   -> [String]   -> Args@@ -46,7 +49,7 @@  takeCs1SortedBy   :: FirstChars -- ^ A pair of the first characters of the starting group delimiter (the same for all 'String's in the all 'CLSpecifications') and the probable its modification (the first character of the last delimiter).-  -> (Arguments -> Arguments -> Ordering) -- ^ A 'compare'-like implementation for 'Arguments'. If needed you can implement your own 'Ord' instance for 'Arguments' and use it here. Here can be partial, just for 'C's.+  -> (Arguments -> Arguments -> Ordering) -- ^ A 'compare'-like implementation for 'Arguments'. If needed you can implement your own 'Ord' instance for 'Arguments' and use it here. Here it can be partial, just for 'C's.   -> CLSpecifications   -> [String]   -> Args@@ -54,7 +57,7 @@ {-# INLINABLE takeCs1SortedBy #-}  takeBsSortedBy-  :: (Arguments -> Arguments -> Ordering) -- ^ A 'compare'-like implementation for 'Arguments'. If needed you can implement your own 'Ord' instance for 'Arguments' and use it here. Here can be partial, just for 'B's.+  :: (Arguments -> Arguments -> Ordering) -- ^ A 'compare'-like implementation for 'Arguments'. If needed you can implement your own 'Ord' instance for 'Arguments' and use it here. Here it can be partial, just for 'B's.   -> CLSpecifications   -> [String]   -> Args@@ -62,7 +65,7 @@ {-# INLINABLE takeBsSortedBy #-}  takeAsSortedBy-  :: (Arguments -> Arguments -> Ordering) -- ^ A 'compare'-like implementation for 'Arguments'. If needed you can implement your own 'Ord' instance for 'Arguments' and use it here. Here can be partial, just for 'A's.+  :: (Arguments -> Arguments -> Ordering) -- ^ A 'compare'-like implementation for 'Arguments'. If needed you can implement your own 'Ord' instance for 'Arguments' and use it here. Here it can be partial, just for 'A's.   -> CLSpecifications   -> [String]   -> Args
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2021-2022 OleksandrZhabenko+Copyright (c) 2021-2023 OleksandrZhabenko  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
cli-arguments.cabal view
@@ -4,14 +4,14 @@ -- http://haskell.org/cabal/users-guide/  name:                cli-arguments-version:             0.6.0.0+version:             0.7.0.0 synopsis:            A library to process command line arguments in some more convenient way. description:         Uses three types of the command line arguments and order of their parsing. All groups usually are not nested one into the others (but using the sequence of parsing functions, you can parse also nested structures as well). -- bug-reports: license:             MIT license-file:        LICENSE author:              OleksandrZhabenko-maintainer:          olexandr543@yahoo.com+maintainer:          oleksandr.zhabenko@yahoo.com copyright:           Oleksandr Zhabenko category:            CLI build-type:          Simple@@ -20,7 +20,7 @@ library   exposed-modules:     CLI.Arguments, CLI.Arguments.Parsing, CLI.Arguments.Arr, CLI.Arguments.Get, CLI.Arguments.Sorted   -- other-modules:-  -- other-extensions:-  build-depends:       base >=4.8 && <5+  other-extensions:    NoImplicitPrelude+  build-depends:       base >=4.13 && <5   -- hs-source-dirs:   default-language:    Haskell2010