add --batch
This commit is contained in:
parent
5a781f4e8f
commit
7d0ece86f6
6 changed files with 51 additions and 13 deletions
|
@ -54,3 +54,14 @@ batchInput parser a = do
|
|||
batchInput parser a
|
||||
where
|
||||
parseerr s = error $ "Batch input parse failure: " ++ s
|
||||
|
||||
-- Runs a CommandStart in batch mode.
|
||||
--
|
||||
-- The batch mode user expects to read a line of output, and it's up to the
|
||||
-- CommandStart to generate that output as it succeeds or fails to do its
|
||||
-- job. However, if it stops without doing anything, it won't generate
|
||||
-- any output, so in that case, batchBadInput is used to provide the caller
|
||||
-- with an empty line.
|
||||
batchCommandAction :: CommandStart -> Annex ()
|
||||
batchCommandAction a = maybe (batchBadInput Batch) (const noop)
|
||||
=<< callCommandAction' a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue