Skip to content

proc.windows

Encodes and decodes arguments for Windows native process launches.

These functions follow the MSVC-compatible convention used by Rust process launching; they do not parse cmd.exe or PowerShell syntax.

Functions

join iterable -> Str

Encodes an iterable of arguments as one Windows process command line.

Parameters

NameTypeDescription
iterable Iterable[Value] Values, each converted to a string as std.verbatim would.

Errors

Exception Condition
ValueError A value contains a NUL character

Example

assert_eq (join ["program", "two words"]) r#"program "two words""#

quote arg -> Str

Encodes one argument for a Windows process command line.

Parameters

NameTypeDescription
arg Value to quote, converted to a string as std.verbatim would.

Errors

Exception Condition
ValueError The argument contains a NUL character

Example

assert_eq (quote "two words") r#""two words""#

split command_line -> Iter[Str]

Decodes a Windows process command line into its arguments.

Parameters

NameTypeDescription
command_line Str Command line to decode.

Errors

Exception Condition
TypeError command_line is not a Str

Example

assert_eq [...(split r#"program "two words""#)] ["program", "two words"]