1
0
forked from GitHub/gf-core

ps -lines preserves line-by-line structure when preprocessing files for parsing line by line

This commit is contained in:
aarne
2014-10-17 15:50:03 +00:00
parent 5c862a3c7b
commit 6c2e0d5ce2

View File

@@ -698,8 +698,14 @@ allCommands = Map.fromList [
exec = \_ opts x -> do
let (os,fs) = optsAndFlags opts
trans <- optTranslit opts
return ((fromString . trans . stringOps (envFlag fs) (map prOpt os) . toString) x),
options = stringOpOptions,
if isOpt "lines" opts
then return $ fromStrings $ map (trans . stringOps (envFlag fs) (map prOpt os)) $ toStrings x
else return ((fromString . trans . stringOps (envFlag fs) (map prOpt os) . toString) x),
options = [
("lines","apply the operation separately to each input line, returning a list of lines")
] ++
stringOpOptions,
flags = [
("env","apply in this environment only"),
("from","backward-apply transliteration defined in this file (format 'unicode translit' per line)"),