summaryrefslogtreecommitdiff
path: root/Command/Drop.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Drop.hs')
-rw-r--r--Command/Drop.hs13
1 files changed, 8 insertions, 5 deletions
diff --git a/Command/Drop.hs b/Command/Drop.hs
index 89e7c8e42..f76951f08 100644
--- a/Command/Drop.hs
+++ b/Command/Drop.hs
@@ -18,15 +18,18 @@ import Annex.Content
import Config
def :: [Command]
-def = [dontCheck fromOpt $ command "drop" paramPaths seek
+def = [withOptions [fromOption] $ command "drop" paramPaths seek
"indicate content of files not currently wanted"]
+fromOption :: Option
+fromOption = fieldOption ['f'] "from" paramRemote "drop content from a remote"
+
seek :: [CommandSeek]
-seek = [withNumCopies $ \n -> whenAnnexed $ start n]
+seek = [withField "from" id $ \from -> withNumCopies $ \n ->
+ whenAnnexed $ start from n]
-start :: Maybe Int -> FilePath -> (Key, Backend) -> CommandStart
-start numcopies file (key, _) = autoCopies key (>) numcopies $ do
- from <- Annex.getState Annex.fromremote
+start :: Maybe String -> Maybe Int -> FilePath -> (Key, Backend) -> CommandStart
+start from numcopies file (key, _) = autoCopies key (>) numcopies $ do
case from of
Nothing -> startLocal file numcopies key
Just name -> do