diff options
Diffstat (limited to 'Command/LookupKey.hs')
-rw-r--r-- | Command/LookupKey.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Command/LookupKey.hs b/Command/LookupKey.hs index 0485232ae..6e7f07049 100644 --- a/Command/LookupKey.hs +++ b/Command/LookupKey.hs @@ -9,18 +9,20 @@ module Command.LookupKey where import Common.Annex import Command +import CmdLine.Batch import Annex.CatFile import Types.Key cmd :: [Command] -cmd = [notBareRepo $ noCommit $ noMessages $ +cmd = [withOptions [batchOption] $ notBareRepo $ noCommit $ noMessages $ command "lookupkey" (paramRepeating paramFile) seek SectionPlumbing "looks up key used for file"] seek :: CommandSeek -seek = withStrings start +seek = batchable withStrings start -start :: String -> CommandStart -start file = do - liftIO . maybe exitFailure (putStrLn . key2file) =<< catKeyFile file +start :: Batchable String +start batchmode file = do + maybe (batchBadInput batchmode) (liftIO . putStrLn . key2file) + =<< catKeyFile file stop |