]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/process.rs
Add note to process::arg[s] that args shouldn't be escaped or quoted
[rust.git] / library / std / src / process.rs
index a1499467744041b1133a592ed1f8de6593841e87..ae4a077587565e84bda2787f4d2cd3fe74127105 100644 (file)
@@ -557,6 +557,9 @@ pub fn new<S: AsRef<OsStr>>(program: S) -> Command {
     ///
     /// [`args`]: Command::args
     ///
+    /// Note that the argument is passed to the program directly as is, so you shouldn't wrap it in quotes
+    /// or escape special characters the same way you would do that when running the program from terminal.
+    ///
     /// # Examples
     ///
     /// Basic usage:
@@ -582,6 +585,9 @@ pub fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Command {
     ///
     /// [`arg`]: Command::arg
     ///
+    /// Note that each argument is passed to the program directly as is, so you shouldn't wrap it in quotes
+    /// or escape special characters the same way you would do that when running the program from terminal directly.
+    ///
     /// # Examples
     ///
     /// Basic usage: