Skip to main content

join_arguments

Function join_arguments 

Source
pub fn join_arguments<I, S>(arguments: I) -> Result<String, NulError>
where I: IntoIterator<Item = S>, S: AsRef<str>,
Expand description

Encodes arguments as one MSVC-compatible Windows command line.

Returns NulError when an argument contains a NUL character.

use dolang_winterop::process::{join_arguments, split_arguments};

let command_line = join_arguments(["tool", "two words", r#"a\"quote"#])?;
assert_eq!(split_arguments(&command_line), ["tool", "two words", r#"a\"quote"#]);