about summary refs log tree commit diff
path: root/library/std/src/process.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-12-27 18:13:23 +0000
committerbors <bors@rust-lang.org>2022-12-27 18:13:23 +0000
commit92c1937a90e5b6f20fa6e87016d6869da363972e (patch)
tree7b2ff592ca5e6039326aead52a9aa562d18c938e /library/std/src/process.rs
parentdb7962532610cfbfb9be17e8d6c1b48acf5ed184 (diff)
parenteb63dea57f4e7d9f07810515b0e43966fc4d78e4 (diff)
downloadrust-92c1937a90e5b6f20fa6e87016d6869da363972e.tar.gz
rust-92c1937a90e5b6f20fa6e87016d6869da363972e.zip
Auto merge of #97176 - kraktus:cmd_debug, r=the8472
More verbose `Debug` implementation of `std::process:Command`

Mainly based on commit: https://github.com/zackmdavis/rust/commit/ccc019aabfdd550944c049625e66c92c815ea1d0 from https://github.com/zackmdavis

close https://github.com/rust-lang/rust/issues/42200
Diffstat (limited to 'library/std/src/process.rs')
-rw-r--r--library/std/src/process.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/library/std/src/process.rs b/library/std/src/process.rs
index 17aff342c15..c1da395bfc5 100644
--- a/library/std/src/process.rs
+++ b/library/std/src/process.rs
@@ -1038,6 +1038,15 @@ impl fmt::Debug for Command {
     /// Format the program and arguments of a Command for display. Any
     /// non-utf8 data is lossily converted using the utf8 replacement
     /// character.
+    ///
+    /// The default format approximates a shell invocation of the program along with its
+    /// arguments. It does not include most of the other command properties. The output is not guaranteed to work
+    /// (e.g. due to lack of shell-escaping or differences in path resolution)
+    /// On some platforms you can use [the alternate syntax] to show more fields.
+    ///
+    /// Note that the debug implementation is platform-specific.
+    ///
+    /// [the alternate syntax]: fmt#sign0
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         self.inner.fmt(f)
     }