summaryrefslogtreecommitdiff
path: root/Command/DropKey.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-03-15 22:42:34 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-03-15 22:42:34 -0400
commit2e1cc2f8b98aaf9e01b620d557c42d5b1ae2aaa6 (patch)
tree57ad758d6a1e193a2cf9974e1d4172f500548e6f /Command/DropKey.hs
parentda504f647fdbec7aa3a3c08244520de2c00898ef (diff)
fixed dropkey, setkey, and git-annex-shell subcommands
key is now specified as the full key, no --backend needed
Diffstat (limited to 'Command/DropKey.hs')
-rw-r--r--Command/DropKey.hs14
1 files changed, 5 insertions, 9 deletions
diff --git a/Command/DropKey.hs b/Command/DropKey.hs
index f0450eea3..419d9caa4 100644
--- a/Command/DropKey.hs
+++ b/Command/DropKey.hs
@@ -14,6 +14,7 @@ import LocationLog
import Types
import Content
import Messages
+import Key
command :: [Command]
command = [Command "dropkey" (paramRepeating paramKey) seek
@@ -22,21 +23,16 @@ command = [Command "dropkey" (paramRepeating paramKey) seek
seek :: [CommandSeek]
seek = [withKeys start]
-{- Drops cached content for a key. -}
-start :: CommandStartString
-start keyname = do
- backends <- Backend.list
- let key = error "fixme!!"
- --let key = genKey (head backends) keyname --TODO FIXME
- let present = error "fixme!!"
- --present <- inAnnex key
+start :: CommandStartKey
+start key = do
+ present <- inAnnex key
force <- Annex.getState Annex.force
if not present
then return Nothing
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" keyname
+ showStart "dropkey" (show key)
return $ Just $ perform key
perform :: Key -> CommandPerform