diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-09-16 12:05:14 +0100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2021-09-17 14:27:02 +0100 |
commit | d6f81eb4e6037430d1e0febb4d3141c479fe2e74 (patch) | |
tree | ebdbe1535138f97d93a3c6ddb5f67574f7bafd6b | |
parent | 2d15175266d0e0d9ca6565124b0c17e207b5541c (diff) | |
download | haskell-wip/t20304.tar.gz |
docs: Fix examples for (un)escapeArgswip/t20304
The examples were just missing the surrounding brackets.
ghci> escapeArgs ["hello \"world\""]
"hello\\ \\\"world\\\"\n"
Fixes #20340
-rw-r--r-- | libraries/base/GHC/ResponseFile.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libraries/base/GHC/ResponseFile.hs b/libraries/base/GHC/ResponseFile.hs index 1b6c2b8647..6d3df4454b 100644 --- a/libraries/base/GHC/ResponseFile.hs +++ b/libraries/base/GHC/ResponseFile.hs @@ -77,7 +77,7 @@ getArgsWithResponseFiles = getArgs >>= expandResponse -- are between the original, un-concatenated list of strings. These -- added whitespace characters are removed from the output. -- --- > unescapeArgs "hello\\ \\\"world\\\"\n" == escapeArgs "hello \"world\"" +-- > unescapeArgs "hello\\ \\\"world\\\"\n" == ["hello \"world\""] unescapeArgs :: String -> [String] unescapeArgs = filter (not . null) . unescape @@ -96,7 +96,7 @@ unescapeArgs = filter (not . null) . unescape -- and thus will always escape any whitespace, quotes, and -- backslashes. -- --- > unescapeArgs "hello\\ \\\"world\\\"\\n" == escapeArgs "hello \"world\"" +-- > escapeArgs ["hello \"world\""] == "hello\\ \\\"world\\\"\n" escapeArgs :: [String] -> String escapeArgs = unlines . map escapeArg |