diff options
| author | aarne <aarne@chalmers.se> | 2014-10-17 15:50:03 +0000 |
|---|---|---|
| committer | aarne <aarne@chalmers.se> | 2014-10-17 15:50:03 +0000 |
| commit | 6c2e0d5ce28e4ed1ff35d7795b80988142190524 (patch) | |
| tree | 74bf0f6a785b65af8c25176bec7e56675c888f19 /src/compiler/GF/Command/Commands.hs | |
| parent | 5c862a3c7bda63886426a785357bad03b839dfa9 (diff) | |
ps -lines preserves line-by-line structure when preprocessing files for parsing line by line
Diffstat (limited to 'src/compiler/GF/Command/Commands.hs')
| -rw-r--r-- | src/compiler/GF/Command/Commands.hs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs index e1a5a3438..e67de95cf 100644 --- a/src/compiler/GF/Command/Commands.hs +++ b/src/compiler/GF/Command/Commands.hs @@ -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)"), |
