summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Command/CommonCommands.hs
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2015-09-03 20:42:38 +0000
committerhallgren <hallgren@chalmers.se>2015-09-03 20:42:38 +0000
commit32f18b515e55f2e4bad42ffe8451e23437410bbc (patch)
tree7f01d23655f80f3ada9631bb5634a790b012b270 /src/compiler/GF/Command/CommonCommands.hs
parent829e1bbfd3671dc9f2f590f5ed05303a0f899c97 (diff)
GF shell: write_file now writes one tree per line
This compensates for other changes that removed line breaks. Maybe it should have a -lines options like ps and rf?
Diffstat (limited to 'src/compiler/GF/Command/CommonCommands.hs')
-rw-r--r--src/compiler/GF/Command/CommonCommands.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/GF/Command/CommonCommands.hs b/src/compiler/GF/Command/CommonCommands.hs
index 63dba526d..0037ba249 100644
--- a/src/compiler/GF/Command/CommonCommands.hs
+++ b/src/compiler/GF/Command/CommonCommands.hs
@@ -193,8 +193,8 @@ commonCommands = fmap (mapCommandExec liftSIO) $ Map.fromList [
exec = \opts arg-> do
let file = valStrOpts "file" "_gftmp" opts
if isOpt "append" opts
- then restricted $ appendFile file (toString arg)
- else restricted $ writeUTF8File file (toString arg)
+ then restricted $ appendFile file (toLines arg)
+ else restricted $ writeUTF8File file (toLines arg)
return void,
options = [
("append","append to file, instead of overwriting it")
@@ -259,3 +259,7 @@ trie = render . pptss . H.toTrie . map H.toATree
H.Oth e -> pp (H.showExpr [] e)
H.Ap f [[]] -> pp (H.showCId f)
H.Ap f tss -> H.showCId f $$ nest 2 (pptss tss)
+
+-- ** Converting command input
+toString = unwords . toStrings
+toLines = unlines . toStrings \ No newline at end of file