diff options
author | Joey Hess <joey@kitenet.net> | 2011-05-15 02:02:46 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-05-15 02:02:46 -0400 |
commit | 56bc3e95cabb85e5f23e30b453f90438c33efbb8 (patch) | |
tree | c13ac69cfc2b5ba9582aa5c1ebd427bc0d337b16 /Command/DropKey.hs | |
parent | b400984ddf9aeb24c3d67e87cfeb29470618636c (diff) |
refactor some boilerplate
Diffstat (limited to 'Command/DropKey.hs')
-rw-r--r-- | Command/DropKey.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Command/DropKey.hs b/Command/DropKey.hs index 4c6f1ab2e..780fe0adf 100644 --- a/Command/DropKey.hs +++ b/Command/DropKey.hs @@ -26,20 +26,19 @@ start key = do present <- inAnnex key force <- Annex.getState Annex.force if not present - then return Nothing + then stop else if not force then error "dropkey is can cause data loss; use --force if you're sure you want to do this" else do showStart "dropkey" (show key) - return $ Just $ perform key + next $ perform key perform :: Key -> CommandPerform perform key = do removeAnnex key - return $ Just $ cleanup key + next $ cleanup key cleanup :: Key -> CommandCleanup cleanup key = do logStatus key ValueMissing return True - |