Commit Graph

224 Commits

Author SHA1 Message Date
Pirh
6f653bb1b1 Document defaults for stdin, stdout, and stderr methods of Command 2017-10-09 19:20:07 +01:00
Pirh
32c4b71471 Link std::process::Output to Command and Child 2017-10-08 22:16:09 +01:00
Pirh
977200310a Remove ./ prefix from relative URLs
Also remove trailing whitespace to pass tidy checks.
2017-10-08 19:09:16 +01:00
Pirh
19029d5627 Add links and examples for std::process::Stdio
As per #29370
2017-10-08 17:12:14 +01:00
Thayne McCombs
29b319b6b2 Change current_pid to just id. 2017-10-07 20:59:58 -06:00
Thayne McCombs
ba7575886e Add missing colon. 2017-10-07 00:55:58 -06:00
Thayne McCombs
6ff6b93560 Add current_pid function
Fixes #44971
2017-10-06 01:15:49 -06:00
Pirh
28ef0d1085 Document that process::abort will not call the panic hook 2017-10-02 19:59:50 +01:00
Corey Farwell
8ef5447815 Migrate to eprint/eprintln macros where appropriate. 2017-09-28 11:38:35 -04:00
Pirh
7ab20c850e Explain difference between panic! and abort in abort docs
As per #29370
2017-09-27 22:47:21 +01:00
Pirh
6dfa45d2ed Remove extraneous brackets from abort documentation
As per #29370
2017-09-27 21:13:07 +01:00
Corey Farwell
859ebef62f Add note about being blocked on input. 2017-09-21 21:11:11 -04:00
Corey Farwell
5ee7db6a0e Remove platform-specific terminology. 2017-09-21 21:01:51 -04:00
Corey Farwell
a1f9052be7 Expand some of the std{in,out,err} usages. 2017-09-15 23:22:26 -04:00
Corey Farwell
a6ef99e9f4 Indicate how ChildStd{in,out,err} FDs are closed.
Fixes https://github.com/rust-lang/rust/issues/41452.
2017-09-15 23:22:25 -04:00
Zack M. Davis
1b6c9605e4 use field init shorthand EVERYWHERE
Like #43008 (f668999), but _much more aggressive_.
2017-08-15 15:29:17 -07:00
Alex Crichton
8e7849e766 rustbuild: Use Cargo's "target runner"
This commit leverages a relatively new feature in Cargo to execute
cross-compiled tests, the `target.$target.runner` configuration. We configure it
through environment variables in rustbuild and this avoids the need for us to
locate and run tests after-the-fact, instead relying on Cargo to do all that
execution for us.
2017-07-28 18:00:31 -07:00
Petr Zemek
3cefd2b1d5 Add a missing verb to the description of std::process::ExitStatus::success().
"Signal termination not considered" -> "Signal termination is not considered"

The first line of the description was rewrapped so it fits into 80 characters.
2017-07-21 08:44:53 +02:00
Steven Fackler
14c2f99f80 Stabilize Command::envs
Closes #38526
2017-06-24 19:19:26 -07:00
kennytm
4711982314 Removed as many "```ignore" as possible.
Replaced by adding extra imports, adding hidden code (`# ...`), modifying
examples to be runnable (sorry Homura), specifying non-Rust code, and
converting to should_panic, no_run, or compile_fail.

Remaining "```ignore"s received an explanation why they are being ignored.
2017-06-23 15:31:53 +08:00
Steven Fackler
ecbb896b9e Add Read::initializer.
This is an API that allows types to indicate that they can be passed
buffers of uninitialized memory which can improve performance.
2017-06-20 20:26:22 -07:00
Josh Stone
9debe91675 Add conversions from File and Child* handles to Stdio
`Stdio` now implements `From<ChildStdin>`, `From<ChildStdout>`,
`From<ChildStderr>`, and `From<File>`.

The `Command::stdin`/`stdout`/`stderr` methods now take any type that
implements `Into<Stdio>`.

This makes it much easier to write shell-like command chains, piping to
one another and redirecting to and from files.  Otherwise one would need
to use the unsafe and OS-specific `from_raw_fd` or `from_raw_handle`.
2017-06-06 15:42:55 -07:00
bors
f6cc40f168 Auto merge of #41904 - sfackler:1.18-stabilization, r=alexcrichton
Stabilize library features for 1.18.0

Closes #38863
Closes #38980
Closes #38903
Closes #36648

r? @alexcrichton

@rust-lang/libs
2017-05-21 22:06:08 +00:00
Steven Fackler
7c2cd93b2b Stabilize library features for 1.18.0
Closes #38863
Closes #38980
Closes #38903
Closes #36648
2017-05-20 21:58:47 -07:00
Michael Kohl
b2fc7b1cbe Add documentation for ExitStatus
As requested in #29370.
2017-05-18 16:58:40 +07:00
Michael Gattozzi
28a4f57dd0 Update ChildStdin/ChildStdout docs to be clearer 2017-05-03 01:13:18 -04:00
Corey Farwell
7423966714 Fix incorrect hex value in doc comment example. 2017-05-01 20:38:59 -04:00
Corey Farwell
83e22b8b24 Rollup merge of #40812 - mgattozzi:ChildDocs, r=steveklabnik
Update `Child` docs to not have a note section

In #29370 it's noted that for "the Note shouldn't be one, and should come before
the examples." This commit changes the positioning of the section and removes
wording that said take note in order for it to flow better with the surrounding
text and it's new position.
2017-04-20 13:33:12 -04:00
Michael Gattozzi
df383b9547 Fix link for wait 2017-04-19 14:00:50 -04:00
bors
fa332c9015 Auto merge of #40829 - mgattozzi:ChildStderr, r=steveklabnik
Update ChildStderr docs to be clearer

Before the docs only had a line about where it was found and that it was
a handle to stderr. This commit changes it so that the summary second line is
removed and that it's a bit clearer about what can be done with it. Part of
#29370
2017-04-09 15:30:20 +00:00
raph
16c77d7da1 Update process.rs 2017-04-06 10:17:32 +02:00
raph
4e1147f340 Add example to std::process::abort
This is a second (2/3?) step in order to complete this issue: https://github.com/rust-lang/rust/issues/29370
I submitted this PR with the help of @steveklabnik again. Thanks to him! More info here: https://github.com/rust-lang/rust/issues/29370#issuecomment-290653877
2017-04-05 20:41:43 +02:00
Michael Gattozzi
c7f2dbef90 Change docs to follow review requests 2017-04-04 16:23:52 -04:00
raph
1be84cee75 Update process.rs 2017-03-30 09:55:44 +02:00
raph
5a7e9ad64a Removing trailing spaces 2017-03-29 16:30:39 +02:00
raph
3ac27c3e54 adding /// 2017-03-29 16:19:23 +02:00
raph
022bae8a4a Add example to std::process::abort 2017-03-29 15:59:22 +02:00
Michael Gattozzi
1d59c67942 Update ChildStderr docs to be clearer
Before the docs only had a line about where it was found and that it was
a handle to stderr. This commit changes it so that the summary second line is
removed and that it's a bit clearer about what can be done with it. Part of
\#29370
2017-03-25 17:19:36 -04:00
Michael Gattozzi
7ef1b39b25 Remove extra wait from Child docs 2017-03-25 16:16:50 -04:00
Michael Gattozzi
bde6336976 Update Child docs to not have a note section
In #29370 it's noted that for "the Note shouldn't be one, and should come before
the examples." This commit changes the positioning of the section and removes
wording that said take note in order for it to flow better with the surrounding
text and it's new position.
2017-03-24 23:29:23 -04:00
Petr Zemek
432673a8dd Add a missing feature attribute to the example for std::process::Command::envs().
The person who originally wrote the example forgot to include this attribute.
This caused Travis CI to fail on commit 9b0a4a4e97 (#40794), which just fixed
formatting in the description of std::process::Command::envs().
2017-03-24 15:47:45 +01:00
Petr Zemek
9b0a4a4e97 Fix formatting in the docs for std::process::Command::envs().
An empty line between the "Basic usage:" text and the example is required to
properly format the code. Without the empty line, the example is not formatted
as code.
2017-03-24 09:42:21 +01:00
Corey Farwell
42cfdc1955 Rollup merge of #40312 - jdhorwitz:papercut, r=steveklabnik
Papercut

r? @steveklabnik
2017-03-20 23:44:56 -04:00
Aaron Turon
9511fe60ce Stabilize process_abort feature, closes #37838 2017-03-17 13:28:37 -07:00
Joshua Horwitz
e2b4824b88 Removed RustFMT changes 2017-03-09 18:17:45 -05:00
Robin Stocker
8079bf35c5 Example for how to provide stdin using std::process::Command
Spawning a child process and writing to its stdin is a bit tricky due to
`as_mut` and having to use a limited borrow. An example for this might
help newer users.
2017-02-27 17:04:18 +11:00
Jack O'Connor
2a345bbcc1 make Child::try_wait return io::Result<Option<ExitStatus>>
This is much nicer for callers who want to short-circuit real I/O errors
with `?`, because they can write this

    if let Some(status) = foo.try_wait()? {
        ...
    } else {
        ...
    }

instead of this

    match foo.try_wait() {
        Ok(status) => {
            ...
        }
        Err(err) if err.kind() == io::ErrorKind::WouldBlock => {
            ...
        }
        Err(err) => return Err(err),
    }

The original design of `try_wait` was patterned after the `Read` and
`Write` traits, which support both blocking and non-blocking
implementations in a single API. But since `try_wait` is never blocking,
it makes sense to optimize for the non-blocking case.

Tracking issue: https://github.com/rust-lang/rust/issues/38903
2017-02-06 23:04:47 -05:00
Corey Farwell
65b24779a9 Rollup merge of #39393 - ollie27:stab_impls, r=alexcrichton
Fix a few impl stability attributes

The versions show up in rustdoc.
2017-02-05 09:14:45 -05:00
Corey Farwell
001bfb9e56 Rollup merge of #38518 - nagisa:exec-doc, r=alexcrichton
Expand documentation of process::exit and exec

Show a conventional way to use process::exit when destructors are considered important and also
mention that the same caveats wrt destructors apply to exec as well.
2017-02-05 09:14:34 -05:00
Oliver Middleton
9128f6100c Fix a few impl stability attributes
The versions show up in rustdoc.
2017-01-29 13:31:47 +00:00