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:
Joey Hess 2022-08-03 11:16:04 -04:00
parent e005bd6f98
commit 3a513cfe73
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
10 changed files with 78 additions and 27 deletions

View file

@ -128,6 +128,12 @@ parseUUIDOption :: String -> DeferredParse UUID
parseUUIDOption = DeferredParse
. (Remote.nameToUUID)
parseDryRunOption :: Parser DryRun
parseDryRunOption = DryRun <$> switch
( long "dry-run"
<> help "don't make changes, but show what would be done"
)
-- | From or To a remote.
data FromToOptions
= FromRemote (DeferredParse Remote)