about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2016-09-30 13:44:47 -0400
committerGitHub <noreply@github.com>2016-09-30 13:44:47 -0400
commite3e5f1fea398af40e450701484cf3e2b36e8debb (patch)
tree0b6ae2acfd41c631cd066a64ef582a4c3b711e74 /src/libstd
parenta6f0a41b1471a3f17bea352afe5bd83fcf1bb80f (diff)
parent3176ba42e206bb9f17d292e1c9225479e8ea5d98 (diff)
downloadrust-e3e5f1fea398af40e450701484cf3e2b36e8debb.tar.gz
rust-e3e5f1fea398af40e450701484cf3e2b36e8debb.zip
Rollup merge of #36841 - GuillaumeGomez:process_doc, r=steveklabnik
Improve process module doc a bit

r? @steveklabnik
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/process.rs20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/libstd/process.rs b/src/libstd/process.rs
index f0c44430700..674b0009537 100644
--- a/src/libstd/process.rs
+++ b/src/libstd/process.rs
@@ -8,7 +8,25 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! Working with processes.
+//! A module for working with processes.
+//!
+//! # Examples
+//!
+//! Basic usage where we try to execute the `cat` shell command:
+//!
+//! ```should_panic
+//! use std::process::Command;
+//!
+//! let mut child = Command::new("/bin/cat")
+//!                         .arg("file.txt")
+//!                         .spawn()
+//!                         .expect("failed to execute child");
+//!
+//! let ecode = child.wait()
+//!                  .expect("failed to wait on child");
+//!
+//! assert!(ecode.success());
+//! ```
 
 #![stable(feature = "process", since = "1.0.0")]