add --dry-run: New option
This is intended for users who want to see what it would output in order to eg, check if a file would be added to git or the annex. It is not intended as a way for scripts to get information. Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
parent
e005bd6f98
commit
3a513cfe73
10 changed files with 78 additions and 27 deletions
|
@ -106,6 +106,12 @@ stop = return Nothing
|
|||
stopUnless :: Annex Bool -> Annex (Maybe a) -> Annex (Maybe a)
|
||||
stopUnless c a = ifM c ( a , stop )
|
||||
|
||||
{- When doing a dry run, avoid actually performing the action, but pretend
|
||||
- that it succeeded. -}
|
||||
skipWhenDryRun :: DryRun -> CommandPerform -> CommandPerform
|
||||
skipWhenDryRun (DryRun False) a = a
|
||||
skipWhenDryRun (DryRun True) _ = next $ return True
|
||||
|
||||
{- When acting on a failed transfer, stops unless it was in the specified
|
||||
- direction. -}
|
||||
checkFailedTransferDirection :: ActionItem -> Direction -> Annex (Maybe a) -> Annex (Maybe a)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue