separate_arguments.rst 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. separate_arguments
  2. ------------------
  3. Parse space-separated arguments into a semicolon-separated list.
  4. ::
  5. separate_arguments(<var> <UNIX|WINDOWS>_COMMAND "<args>")
  6. Parses a unix- or windows-style command-line string "<args>" and
  7. stores a semicolon-separated list of the arguments in ``<var>``. The
  8. entire command line must be given in one "<args>" argument.
  9. The ``UNIX_COMMAND`` mode separates arguments by unquoted whitespace. It
  10. recognizes both single-quote and double-quote pairs. A backslash
  11. escapes the next literal character (\" is "); there are no special
  12. escapes (\n is just n).
  13. The ``WINDOWS_COMMAND`` mode parses a windows command-line using the same
  14. syntax the runtime library uses to construct argv at startup. It
  15. separates arguments by whitespace that is not double-quoted.
  16. Backslashes are literal unless they precede double-quotes. See the
  17. MSDN article "Parsing C Command-Line Arguments" for details.
  18. ::
  19. separate_arguments(VARIABLE)
  20. Convert the value of ``VARIABLE`` to a semi-colon separated list. All
  21. spaces are replaced with ';'. This helps with generating command
  22. lines.