filter out control characters and quote filenames
Searched for uses of putStr and hPutStr and changed appropriate ones to filter out control characters and quote filenames. This notably does not make find and findkeys quote filenames in their default output. Because they should only do that when stdout is non a pipe. A few commands like calckey and lookupkey seem too low-level to make sense to filter output, so skipped those. Also when relaying output from other commands that is not progress output, have git-annex filter out control characters. Sponsored-by: k0ld on Patreon
This commit is contained in:
parent
11e89c5a29
commit
df6f9f1ee8
15 changed files with 75 additions and 39 deletions
|
@ -15,6 +15,7 @@ import Annex.WorkTree
|
|||
import Messages.JSON (JSONActionItem(..), AddJSONActionItemFields(..))
|
||||
import Types.Messages
|
||||
import Utility.Aeson
|
||||
import Utility.SafeOutput
|
||||
import Limit
|
||||
|
||||
import qualified Data.Set as S
|
||||
|
@ -109,7 +110,7 @@ startKeys c o (si, k, ai) = case getSet o of
|
|||
Get f -> startingCustomOutput k $ do
|
||||
l <- S.toList . currentMetaDataValues f <$> getCurrentMetaData k
|
||||
liftIO $ forM_ l $
|
||||
B8.putStrLn . fromMetaValue
|
||||
B8.putStrLn . safeOutput . fromMetaValue
|
||||
next $ return True
|
||||
_ -> starting "metadata" ai si $
|
||||
perform c o k
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue