examinekey: Added a "file" format variable

For consistency with find, and for easier scripting.
This commit is contained in:
Joey Hess 2020-11-16 09:56:32 -04:00
parent 21ab496f6b
commit 5a8d01f63e
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 25 additions and 10 deletions

View file

@ -9,7 +9,7 @@ module Command.ExamineKey where
import Command
import qualified Utility.Format
import Command.Find (parseFormatOption, showFormatted, keyVars)
import Command.Find (parseFormatOption, showFormatted, formatVars)
import Annex.Link
import Backend
import Types.Backend
@ -57,7 +57,7 @@ run o _ input = do
showFormatted (format o) (serializeKey' k) $
[ ("objectpath", fromRawFilePath objectpath)
, ("objectpointer", fromRawFilePath objectpointer)
] ++ keyVars k
] ++ formatVars k af
return True
where
-- Parse the input, which is either a key, or in batch mode