Skip to content

Commit 3176ba4

Browse files
Improve process module doc a bit
1 parent 289f3a4 commit 3176ba4

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/libstd/process.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,25 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Working with processes.
11+
//! A module for working with processes.
12+
//!
13+
//! # Examples
14+
//!
15+
//! Basic usage where we try to execute the `cat` shell command:
16+
//!
17+
//! ```should_panic
18+
//! use std::process::Command;
19+
//!
20+
//! let mut child = Command::new("/bin/cat")
21+
//! .arg("file.txt")
22+
//! .spawn()
23+
//! .expect("failed to execute child");
24+
//!
25+
//! let ecode = child.wait()
26+
//! .expect("failed to wait on child");
27+
//!
28+
//! assert!(ecode.success());
29+
//! ```
1230
1331
#![stable(feature = "process", since = "1.0.0")]
1432

0 commit comments

Comments
 (0)