Skip to content

improve doc comment of PtyProcess.status() method #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,21 @@ impl PtyProcess {
///
/// This method runs waitpid on the process.
/// This means: If you ran `exit()` before or `status()` this method will
/// return an Error
/// return `None`
///
/// # Example
/// ```rust,no_run
///
/// # extern crate rexpect;
/// use rexpect::process;
/// use rexpect::process::{self, wait::WaitStatus};
/// use std::process::Command;
///
/// # fn main() {
/// let cmd = Command::new("/path/to/myprog");
/// let process = process::PtyProcess::new(cmd).expect("could not execute myprog");
/// while process.status().unwrap() == process::wait::WaitStatus::StillAlive {
/// // do something
/// }
/// let cmd = Command::new("/path/to/myprog");
/// let process = process::PtyProcess::new(cmd).expect("could not execute myprog");
/// while let Some(WaitStatus::StillAlive) = process.status() {
/// // do something
/// }
/// # }
/// ```
///
Expand Down