option rf -paragraphs

This commit is contained in:
Aarne Ranta
2018-09-21 10:40:39 +02:00
parent 50e1e7b17e
commit 8787b56def
2 changed files with 17 additions and 4 deletions

View File

@@ -445,6 +445,7 @@ pgfCommands = Map.fromList [
],
options = [
("lines","return the list of lines, instead of the singleton of all contents"),
("paragraphs","return the list of paragraphs, as separated by empty lines"),
("tree","convert strings into trees")
],
exec = getEnv $ \ opts _ (Env pgf mos) -> do
@@ -470,6 +471,7 @@ pgfCommands = Map.fromList [
_ | isOpt "tree" opts ->
returnFromLines [(1::Int,s)]
_ | isOpt "lines" opts -> return (fromStrings $ lines s)
_ | isOpt "paragraphs" opts -> return (fromStrings $ toParagraphs $ lines s)
_ -> return (fromString s),
flags = [("file","the input file name")]
}),