about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2016-09-30 00:10:42 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2016-09-30 00:10:42 +0200
commit3176ba42e206bb9f17d292e1c9225479e8ea5d98 (patch)
tree32d859761a094291846d1809e0b33393a783949c /src/libstd
parent289f3a4ca79916d6445b452fc19a18a1e42a879a (diff)
downloadrust-3176ba42e206bb9f17d292e1c9225479e8ea5d98.tar.gz
rust-3176ba42e206bb9f17d292e1c9225479e8ea5d98.zip
Improve process module doc a bit
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")]