Cabal-3.12.0.0: A framework for packaging Haskell software
Safe HaskellSafe-Inferred
LanguageHaskell2010

Distribution.Compat.ResponseFile

Synopsis

Documentation

expandResponse :: [String] -> IO [String] Source #

The arg file / response file parser.

This is not a well-documented capability, and is a bit eccentric (try cabal @foo @bar to see what that does), but is crucial for allowing complex arguments to cabal and cabal-install when using command prompts with strongly-limited argument length.

escapeArgs :: [String] -> String #

Given a list of strings, concatenate them into a single string with escaping of certain characters, and the addition of a newline between each string. The escaping is done by adding a single backslash character before any whitespace, single quote, double quote, or backslash character, so this escaping character must be removed. Unescaped whitespace (in this case, newline) is part of this "transport" format to indicate the end of the previous string and the start of a new string.

While unescapeArgs allows using quoting (i.e., convenient escaping of many characters) by having matching sets of single- or double-quotes,escapeArgs does not use the quoting mechanism, and thus will always escape any whitespace, quotes, and backslashes.

escapeArgs ["hello \"world\""] == "hello\\ \\\"world\\\"\n"