find, findkeys, examinekey: escape output to terminal when --format is not used
Note that filenames are not quoted, only escaped. This is to match the output of --format with escaping. Sponsored-by: Lawrence Brogan on Patreon
This commit is contained in:
parent
df6f9f1ee8
commit
afa5b883dc
10 changed files with 85 additions and 28 deletions
|
@ -5,6 +5,8 @@
|
|||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Command.ExamineKey where
|
||||
|
||||
import Command
|
||||
|
@ -14,6 +16,7 @@ import Annex.Link
|
|||
import Backend
|
||||
import Types.Backend
|
||||
import Types.Key
|
||||
import Utility.SafeOutput
|
||||
|
||||
import Data.Char
|
||||
import qualified Data.ByteString as B
|
||||
|
@ -54,7 +57,8 @@ run o _ input = do
|
|||
|
||||
objectpath <- calcRepo $ gitAnnexLocation k
|
||||
let objectpointer = formatPointer k
|
||||
showFormatted (format o) (serializeKey' k) $
|
||||
isterminal <- liftIO $ checkIsTerminal stdout
|
||||
showFormatted isterminal (format o) (serializeKey' k) $
|
||||
[ ("objectpath", fromRawFilePath objectpath)
|
||||
, ("objectpointer", fromRawFilePath objectpointer)
|
||||
] ++ formatVars k af
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue