mirror of
https://github.com/ilyakooo0/optparse-applicative.git
synced 2024-11-23 14:43:25 +03:00
Remove Builder.Arguments module.
This commit is contained in:
parent
cbee54f058
commit
c5f1863ebf
@ -88,7 +88,7 @@ module Options.Applicative.Builder (
|
||||
CommandFields
|
||||
) where
|
||||
|
||||
import Control.Applicative (pure, (<|>))
|
||||
import Control.Applicative (pure, (<|>), many, some)
|
||||
import Data.Monoid (Monoid (..)
|
||||
#if __GLASGOW_HASKELL__ > 702
|
||||
, (<>)
|
||||
@ -96,7 +96,6 @@ import Data.Monoid (Monoid (..)
|
||||
)
|
||||
|
||||
import Options.Applicative.Builder.Completer
|
||||
import Options.Applicative.Builder.Arguments
|
||||
import Options.Applicative.Builder.Internal
|
||||
import Options.Applicative.Common
|
||||
import Options.Applicative.Types
|
||||
@ -197,6 +196,22 @@ subparser m = mkParser d g rdr
|
||||
Mod _ d g = m `mappend` metavar "COMMAND"
|
||||
rdr = uncurry CmdReader (mkCommand m)
|
||||
|
||||
-- | Builder for an argument parser.
|
||||
argument :: (String -> Maybe a) -> Mod ArgumentFields a -> Parser a
|
||||
argument p (Mod f d g) = mkParser d g (ArgReader rdr)
|
||||
where
|
||||
ArgumentFields compl = f (ArgumentFields mempty)
|
||||
rdr = CReader compl p
|
||||
|
||||
-- | Builder for an argument list parser. All arguments are collected and
|
||||
-- returned as a list.
|
||||
arguments :: (String -> Maybe a) -> Mod ArgumentFields a -> Parser [a]
|
||||
arguments r m = many (argument r m)
|
||||
|
||||
-- | Like `arguments`, but require at least one argument.
|
||||
arguments1 :: (String -> Maybe a) -> Mod ArgumentFields a -> Parser [a]
|
||||
arguments1 r m = some (argument r m)
|
||||
|
||||
-- | Builder for a flag parser.
|
||||
--
|
||||
-- A flag that switches from a \"default value\" to an \"active value\" when
|
||||
|
@ -1,34 +0,0 @@
|
||||
module Options.Applicative.Builder.Arguments
|
||||
( argument
|
||||
, arguments
|
||||
, arguments1
|
||||
) where
|
||||
|
||||
import Control.Applicative (many, some)
|
||||
import Data.Monoid (mempty)
|
||||
|
||||
import Options.Applicative.Builder.Internal
|
||||
import Options.Applicative.Common
|
||||
import Options.Applicative.Types
|
||||
|
||||
-- | Builder for an argument parser.
|
||||
argument :: (String -> Maybe a) -> Mod ArgumentFields a -> Parser a
|
||||
argument p (Mod f d g) = mkParser d g (ArgReader rdr)
|
||||
where
|
||||
ArgumentFields compl = f (ArgumentFields mempty)
|
||||
rdr = CReader compl p
|
||||
|
||||
-- | Builder for an argument list parser. All arguments are collected and
|
||||
-- returned as a list.
|
||||
--
|
||||
-- Note that arguments starting with @'-'@ are ignored.
|
||||
--
|
||||
-- This parser accepts a special argument: @--@. When a @--@ is found on the
|
||||
-- command line, all following arguments are included in the result, even if
|
||||
-- they start with @'-'@.
|
||||
arguments :: (String -> Maybe a) -> Mod ArgumentFields a -> Parser [a]
|
||||
arguments r m = many (argument r m)
|
||||
|
||||
-- | Like `arguments`, but require at least one argument.
|
||||
arguments1 :: (String -> Maybe a) -> Mod ArgumentFields a -> Parser [a]
|
||||
arguments1 r m = some (argument r m)
|
@ -91,7 +91,6 @@ library
|
||||
Options.Applicative.Arrows,
|
||||
Options.Applicative.BashCompletion,
|
||||
Options.Applicative.Builder,
|
||||
Options.Applicative.Builder.Arguments,
|
||||
Options.Applicative.Builder.Completer,
|
||||
Options.Applicative.Builder.Internal,
|
||||
Options.Applicative.Common,
|
||||
|
Loading…
Reference in New Issue
Block a user