git-annex/Command/ExamineKey.hs
Joey Hess 3c7fd09ec8
get many more commands building again
about half are building now
2019-12-05 11:40:10 -04:00

26 lines
729 B
Haskell

{- git-annex command
-
- Copyright 2013 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU AGPL version 3 or higher.
-}
module Command.ExamineKey where
import Command
import qualified Utility.Format
import Command.Find (parseFormatOption, showFormatted, keyVars)
cmd :: Command
cmd = noCommit $ noMessages $ dontCheck repoExists $
withGlobalOptions [jsonOptions] $
command "examinekey" SectionPlumbing
"prints information from a key"
(paramRepeating paramKey)
(batchable run (optional parseFormatOption))
run :: Maybe Utility.Format.Format -> String -> Annex Bool
run format p = do
let k = fromMaybe (giveup "bad key") $ deserializeKey p
showFormatted format (serializeKey' k) (keyVars k)
return True