Skip to content

Commit

Permalink
process: add raw_arg method to Command (#5704)
Browse files Browse the repository at this point in the history
  • Loading branch information
joriskleiber committed May 19, 2023
1 parent 8c076cb commit 29a6f46
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tokio/src/process/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,22 @@ impl Command {
self
}

/// Append literal text to the command line without any quoting or escaping.
///
/// This is useful for passing arguments to `cmd.exe /c`, which doesn't follow
/// `CommandLineToArgvW` escaping rules.
///
/// **Note**: This is an [unstable API][unstable] but will be stabilised once
/// tokio's MSRV is sufficiently new. See [the documentation on
/// unstable features][unstable] for details about using unstable features.
#[cfg(windows)]
#[cfg(tokio_unstable)]
#[cfg_attr(docsrs, doc(cfg(all(windows, tokio_unstable))))]
pub fn raw_arg<S: AsRef<OsStr>>(&mut self, text_to_append_as_is: S) -> &mut Command {
self.std.raw_arg(text_to_append_as_is);
self
}

/// Inserts or updates an environment variable mapping.
///
/// Note that environment variable names are case-insensitive (but case-preserving) on Windows,
Expand Down

0 comments on commit 29a6f46

Please sign in to comment.