From d49e9f6a744c490cf4374039fde26c0eb57dc675 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 11 Jul 2015 20:43:45 -0400 Subject: converted ContentLocation, ExampleKey, LookupKey --- Command/ExamineKey.hs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'Command/ExamineKey.hs') diff --git a/Command/ExamineKey.hs b/Command/ExamineKey.hs index e0a1d9747..55f72f71b 100644 --- a/Command/ExamineKey.hs +++ b/Command/ExamineKey.hs @@ -11,21 +11,18 @@ import Common.Annex import Command import CmdLine.Batch import qualified Utility.Format -import Command.Find (FindOptions(..), showFormatted, keyVars) +import Command.Find (parseFormatOption, showFormatted, keyVars) import Types.Key cmd :: Command -cmd = noCommit $ noMessages $ withOptions [formatOption, jsonOption, batchOption] $ +cmd = noCommit $ noMessages $ withGlobalOptions [jsonOption] $ command "examinekey" SectionPlumbing "prints information from a key" - (paramRepeating paramKey) (withParams seek) + (paramRepeating paramKey) + (batchable run (optional parseFormatOption)) -seek :: CmdParams -> CommandSeek -seek ps = do - format <- getFormat - batchable withKeys (start format) ps - -start :: Maybe Utility.Format.Format -> Batchable Key -start format _ key = do - showFormatted format (key2file key) (keyVars key) - stop +run :: Maybe Utility.Format.Format -> String -> Annex Bool +run format p = do + let k = fromMaybe (error "bad key") $ file2key p + showFormatted format (key2file k) (keyVars k) + return True -- cgit v1.2.3