aboutsummaryrefslogtreecommitdiff
path: root/Command/ContentLocation.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-05-06 13:44:53 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-05-06 13:44:53 -0400
commit2bbb276e38fb8503daccf7a419336d67c0a23c9c (patch)
treed796474a8b82bc5e79ae99a40ee93fd81cdf83a7 /Command/ContentLocation.hs
parent582fa3e2f10f1e1064314a8a1d9bb5aa5cf84f92 (diff)
contentlocation, examinekey, lookupkey: Added --batch mode option.
Diffstat (limited to 'Command/ContentLocation.hs')
-rw-r--r--Command/ContentLocation.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/Command/ContentLocation.hs b/Command/ContentLocation.hs
index 3f4775f57..10879f5b1 100644
--- a/Command/ContentLocation.hs
+++ b/Command/ContentLocation.hs
@@ -9,19 +9,20 @@ module Command.ContentLocation where
import Common.Annex
import Command
+import CmdLine.Batch
import Annex.Content
cmd :: [Command]
-cmd = [noCommit $ noMessages $
+cmd = [withOptions [batchOption] $ noCommit $ noMessages $
command "contentlocation" (paramRepeating paramKey) seek
SectionPlumbing "looks up content for a key"]
seek :: CommandSeek
-seek = withKeys start
+seek = batchable withKeys start
-start :: Key -> CommandStart
-start k = do
- liftIO . maybe exitFailure putStrLn
+start :: Batchable Key
+start batchmode k = do
+ maybe (batchBadInput batchmode) (liftIO . putStrLn)
=<< inAnnex' (pure True) Nothing check k
stop
where