{-| Patch matching options.

These are all of the same type 'MatchOption' defined below.

Multiple flags per option are allowed and do not raise a conflict error.
This is how Darcs currently operates, even though I suspect that it ignores
all but the first 'MatchFlag' (since it does so for many other options).

Given a suitable semantics (and documentation thereof), for instance \"all
the given patterns must match\", this could be turned into a useful feature.

-}
module Darcs.UI.Options.Matching
    ( MatchFlag(..) -- re-export
    , matchUpToOne
    , matchOneContext
    , matchOneNontag
    , matchSeveral
    , matchSeveralOrFirst
    , matchSeveralOrLast
    , matchRange
    , matchOneOrRange
    , matchSeveralOrRange
    -- * exported for for checking
    , context
    , matchLast
    , matchFrom
    , matchAny -- temporary hack
    ) where

import Darcs.Prelude hiding ( last )

import Darcs.Patch.Match ( MatchFlag(..) )
import qualified Darcs.UI.Options.Flags as F ( DarcsFlag(..) )
import Darcs.UI.Options.Core
import Darcs.UI.Options.Util

-- * Type instantiations

type MatchOption = PrimDarcsOption [MatchFlag]

-- * Combined matching options

matchUpToOne :: MatchOption -- ^ show files/contents, dist, annotate
matchUpToOne :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
matchUpToOne = [PrimOptSpec DarcsOptDescr Flag a [MatchFlag]]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Monoid a => [a] -> a
mconcat [PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
match, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
patch, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
hash, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
tag, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
index]

-- | Used by: clone
matchOneContext :: MatchOption
matchOneContext :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
matchOneContext = [PrimOptSpec DarcsOptDescr Flag a [MatchFlag]]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Monoid a => [a] -> a
mconcat [PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
toMatch, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
toPatch, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
toHash, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
tag, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
context]

-- [NOTE --index removed from matchOneNontag because issue1926]
-- The --index option was removed for 2.5 release because it isn't handled
-- by amend-record (see issue1926).
--
-- At this moment, amend-record is the only command that uses 'matchOneNontag',
-- so there is no other command affected.

-- | Used by: amend
matchOneNontag :: MatchOption
matchOneNontag :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
matchOneNontag =  PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
match PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Semigroup a => a -> a -> a
<> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
patch PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Semigroup a => a -> a -> a
<> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
hash

-- | Used by: rebase pull/apply, send, push, pull, apply, fetch
matchSeveral :: MatchOption
matchSeveral :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
matchSeveral = PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
matches PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Semigroup a => a -> a -> a
<> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
patches PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Semigroup a => a -> a -> a
<> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
tags PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Semigroup a => a -> a -> a
<> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
hash

matchLast :: MatchOption
matchLast :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
matchLast = PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
last

-- | Used by: rebase unsuspend/reify
matchSeveralOrFirst :: MatchOption
matchSeveralOrFirst :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
matchSeveralOrFirst = [PrimOptSpec DarcsOptDescr Flag a [MatchFlag]]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Monoid a => [a] -> a
mconcat [ PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
matchTo, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
last, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
matches, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
patches, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
tags, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
hash ]

-- | Used by: unrecord, obliterate, rebase suspend, rollback
matchSeveralOrLast :: MatchOption
matchSeveralOrLast :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
matchSeveralOrLast = [PrimOptSpec DarcsOptDescr Flag a [MatchFlag]]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Monoid a => [a] -> a
mconcat [ PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
matchFrom, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
last, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
matches, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
patches, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
tags, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
hash ]

-- | Used by: diff
matchOneOrRange :: MatchOption
matchOneOrRange :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
matchOneOrRange = [PrimOptSpec DarcsOptDescr Flag a [MatchFlag]]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Monoid a => [a] -> a
mconcat [ PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
match, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
patch, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
hash ] PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Semigroup a => a -> a -> a
<> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
matchRange

-- | Used by: show dependencies
matchRange :: MatchOption
matchRange :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
matchRange = [PrimOptSpec DarcsOptDescr Flag a [MatchFlag]]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Monoid a => [a] -> a
mconcat [ PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
matchTo, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
matchFrom, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
last, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
indexes ]

-- | Used by: log
matchSeveralOrRange :: MatchOption
matchSeveralOrRange :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
matchSeveralOrRange = [PrimOptSpec DarcsOptDescr Flag a [MatchFlag]]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Monoid a => [a] -> a
mconcat
  [ PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
matchTo, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
matchFrom, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
last, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
indexes, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
matches, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
patches, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
tags, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
hash ]

matchTo :: MatchOption
matchTo :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
matchTo = PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
toMatch PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Semigroup a => a -> a -> a
<> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
toPatch PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Semigroup a => a -> a -> a
<> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
toHash PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Semigroup a => a -> a -> a
<> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
toTag

matchFrom :: MatchOption
matchFrom :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
matchFrom = PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
fromMatch PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Semigroup a => a -> a -> a
<> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
fromPatch PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Semigroup a => a -> a -> a
<> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
fromHash PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Semigroup a => a -> a -> a
<> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
fromTag

matchAny :: MatchOption
matchAny :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
matchAny = [PrimOptSpec DarcsOptDescr Flag a [MatchFlag]]
-> PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
forall a. Monoid a => [a] -> a
mconcat [ PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
toMatch, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
toPatch, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
toHash, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
toTag,
  PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
fromMatch, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
fromPatch, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
fromHash, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
fromTag,
  PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
tag, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
tags, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
patch, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
patches, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
hash, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
match, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
matches, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
index, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
indexes, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
context, PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
MatchOption
last ]

-- * Primitive matching options

toMatch, toPatch, toHash, toTag,
  fromMatch, fromPatch, fromHash, fromTag,
  tag, tags,
  patch, patches,
  hash,
  match, matches,
  index, indexes,
  context, last :: MatchOption

toMatch :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
toMatch = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.UpToPattern String
s | UpToPattern String
s <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ String -> MatchFlag
UpToPattern String
s | F.UpToPattern String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [] [String
"to-match"] String -> Flag
F.UpToPattern String
"PATTERN"
    String
"select changes up to a patch matching PATTERN" ]

toPatch :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
toPatch = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.UpToPatch String
s | UpToPatch String
s <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ String -> MatchFlag
UpToPatch String
s | F.UpToPatch String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [] [String
"to-patch"] String -> Flag
F.UpToPatch String
"REGEXP"
    String
"select changes up to a patch matching REGEXP" ]

toHash :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
toHash = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.UpToHash String
s | UpToHash String
s <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ String -> MatchFlag
UpToHash String
s | F.UpToHash String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [] [String
"to-hash"] String -> Flag
F.UpToHash String
"HASH"
    String
"select changes up to a patch with HASH" ]

context :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
context = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ AbsolutePath -> Flag
F.Context AbsolutePath
p | Context AbsolutePath
p <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ AbsolutePath -> MatchFlag
Context AbsolutePath
p | F.Context AbsolutePath
p <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr AbsolutePath Flag
forall f. SingleArgOptDescr AbsolutePath f
absPathArg [] [String
"context"] AbsolutePath -> Flag
F.Context String
"FILENAME"
    String
"version specified by the context in FILENAME" ]

toTag :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
toTag = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.UpToTag String
s | UpToTag String
s <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ String -> MatchFlag
UpToTag String
s | F.UpToTag String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [] [String
"to-tag"] String -> Flag
F.UpToTag String
"REGEXP"
    String
"select changes up to a tag matching REGEXP" ]

fromMatch :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
fromMatch = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.AfterPattern String
s | AfterPattern String
s <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ String -> MatchFlag
AfterPattern String
s | F.AfterPattern String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [] [String
"from-match"] String -> Flag
F.AfterPattern String
"PATTERN"
    String
"select changes starting with a patch matching PATTERN" ]

fromPatch :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
fromPatch = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.AfterPatch String
s | AfterPatch String
s <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ String -> MatchFlag
AfterPatch String
s | F.AfterPatch String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [] [String
"from-patch"] String -> Flag
F.AfterPatch String
"REGEXP"
    String
"select changes starting with a patch matching REGEXP" ]

fromHash :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
fromHash = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.AfterHash String
s | AfterHash String
s <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ String -> MatchFlag
AfterHash String
s | F.AfterHash String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [] [String
"from-hash"] String -> Flag
F.AfterHash String
"HASH"
    String
"select changes starting with a patch with HASH" ]

fromTag :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
fromTag = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.AfterTag String
s | AfterTag String
s <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ String -> MatchFlag
AfterTag String
s | F.AfterTag String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [] [String
"from-tag"] String -> Flag
F.AfterTag String
"REGEXP"
    String
"select changes starting with a tag matching REGEXP" ]

tag :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
tag = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.OneTag String
s | OneTag String
s <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ String -> MatchFlag
OneTag String
s | F.OneTag String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [Char
't'] [String
"tag"] String -> Flag
F.OneTag String
"REGEXP" String
"select tag matching REGEXP" ]

tags :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
tags = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.OneTag String
s | OneTag String
s <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ String -> MatchFlag
OneTag String
s | F.OneTag String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [Char
't'] [String
"tags"] String -> Flag
F.OneTag String
"REGEXP" String
"select tags matching REGEXP" ]

patch :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
patch = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.OnePatch String
s | OnePatch String
s <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ String -> MatchFlag
OnePatch String
s | F.OnePatch String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [Char
'p'] [String
"patch"] String -> Flag
F.OnePatch String
"REGEXP"
    String
"select a single patch matching REGEXP" ]

patches :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
patches = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.SeveralPatch String
s | SeveralPatch String
s <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ String -> MatchFlag
SeveralPatch String
s | F.SeveralPatch String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [Char
'p'] [String
"patches"] String -> Flag
F.SeveralPatch String
"REGEXP"
    String
"select patches matching REGEXP" ]

hash :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
hash = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.OneHash String
s | OneHash String
s <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ String -> MatchFlag
OneHash String
s | F.OneHash String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [Char
'h'] [String
"hash"] String -> Flag
F.OneHash String
"HASH"
    String
"select a single patch with HASH" ]

match :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
match = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.OnePattern String
s | OnePattern String
s <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ String -> MatchFlag
OnePattern String
s | F.OnePattern String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [] [String
"match"] String -> Flag
F.OnePattern String
"PATTERN"
    String
"select a single patch matching PATTERN" ]

matches :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
matches = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.SeveralPattern String
s | SeveralPattern String
s <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ String -> MatchFlag
SeveralPattern String
s | F.SeveralPattern String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [] [String
"matches"] String -> Flag
F.SeveralPattern String
"PATTERN"
    String
"select patches matching PATTERN" ]

last :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
last = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.LastN (Int -> String
showIntArg Int
n) | LastN Int
n <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ Int -> MatchFlag
LastN (String -> Int
argparse String
s) | F.LastN String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [] [String
"last"] String -> Flag
F.LastN String
"NUMBER" String
"select the last NUMBER patches" ]
  argparse :: String -> Int
argparse = String -> (Int -> Bool) -> String -> Int
parseIntArg String
"count" (Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>=Int
0)

index :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
index = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.OneIndex (Int -> String
showIntArg Int
n) | OneIndex Int
n <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ Int -> MatchFlag
OneIndex (String -> Int
argparse String
s) | F.OneIndex String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [Char
'n'] [String
"index"] String -> Flag
F.OneIndex String
"N" String
"select one patch" ]
  argparse :: String -> Int
argparse = String -> (Int -> Bool) -> String -> Int
parseIntArg String
"index" (Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>Int
0)

indexes :: PrimOptSpec DarcsOptDescr Flag a [MatchFlag]
indexes = OptSpec :: forall (d :: * -> *) f a b.
(([f] -> a) -> b)
-> (b -> [f] -> a) -> ([f] -> [String]) -> [d f] -> OptSpec d f a b
OptSpec {[DarcsOptDescr Flag]
[Flag] -> [String]
([Flag] -> a) -> [MatchFlag] -> a
([MatchFlag] -> a) -> [Flag] -> a
forall t. ([Flag] -> t) -> [MatchFlag] -> t
forall t. ([MatchFlag] -> t) -> [Flag] -> t
forall p a. p -> [a]
odesc :: [DarcsOptDescr Flag]
ocheck :: forall p a. p -> [a]
oparse :: forall t. ([MatchFlag] -> t) -> [Flag] -> t
ounparse :: forall t. ([Flag] -> t) -> [MatchFlag] -> t
odesc :: [DarcsOptDescr Flag]
ocheck :: [Flag] -> [String]
oparse :: ([MatchFlag] -> a) -> [Flag] -> a
ounparse :: ([Flag] -> a) -> [MatchFlag] -> a
..} where
  ounparse :: ([Flag] -> t) -> [MatchFlag] -> t
ounparse [Flag] -> t
k [MatchFlag]
mfs = [Flag] -> t
k [ String -> Flag
F.IndexRange ((Int, Int) -> String
showIndexRangeArg (Int
n,Int
m)) | IndexRange Int
n Int
m <- [MatchFlag]
mfs ]
  oparse :: ([MatchFlag] -> t) -> [Flag] -> t
oparse [MatchFlag] -> t
k [Flag]
fs = [MatchFlag] -> t
k [ (Int -> Int -> MatchFlag) -> (Int, Int) -> MatchFlag
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Int -> Int -> MatchFlag
IndexRange (String -> (Int, Int)
argparse String
s) | F.IndexRange String
s <- [Flag]
fs ]
  ocheck :: p -> [a]
ocheck p
_ = []
  odesc :: [DarcsOptDescr Flag]
odesc = [ SingleArgOptDescr String Flag
forall f. SingleArgOptDescr String f
strArg [Char
'n'] [String
"index"] String -> Flag
F.IndexRange String
"N-M" String
"select a range of patches" ]
  argparse :: String -> (Int, Int)
argparse = String -> (Int, Int)
parseIndexRangeArg