wip
This commit is contained in:
parent
8ad927dbc6
commit
a7f58634b8
11 changed files with 109 additions and 79 deletions
12
Command.hs
12
Command.hs
|
@ -8,6 +8,7 @@
|
|||
module Command (
|
||||
command,
|
||||
withParams,
|
||||
(<--<),
|
||||
noRepo,
|
||||
noCommit,
|
||||
noMessages,
|
||||
|
@ -46,6 +47,17 @@ command name section desc paramdesc mkparser =
|
|||
withParams :: (CmdParams -> v) -> CmdParamsDesc -> O.Parser v
|
||||
withParams mkseek paramdesc = mkseek <$> cmdParams paramdesc
|
||||
|
||||
{- Uses the supplied option parser, which yields a deferred parse,
|
||||
- and calls finishParse on the result before passing it to the
|
||||
- CommandSeek constructor. -}
|
||||
(<--<) :: DeferredParseClass a
|
||||
=> (a -> CommandSeek)
|
||||
-> (CmdParamsDesc -> Parser a)
|
||||
-> CmdParamsDesc
|
||||
-> Parser CommandSeek
|
||||
(<--<) mkseek optparser paramsdesc =
|
||||
(mkseek <=< finishParse) <$> optparser paramsdesc
|
||||
|
||||
{- Indicates that a command doesn't need to commit any changes to
|
||||
- the git-annex branch. -}
|
||||
noCommit :: Command -> Command
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue