1
Fork 0
Commit graph

226 commits

Author SHA1 Message Date
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Alexander Regueiro
ee89c088b0 Various minor/cosmetic improvements to code 2018-12-07 23:53:34 +00:00
Alex Crichton
d1cd4e8d0d Move a flaky process test out of libstd
This test ensures that everything in `env::vars()` is inherited but
that's not actually true because other tests may add env vars after we
spawn the process, causing the test to be flaky! This commit moves the
test to a run-pass test where it can execute in isolation.

Along the way this removes a lot of the platform specificity of the
test, using iteslf to print the environment instead of a foreign process.
2018-11-21 21:56:23 -08:00
Pietro Albini
66fcb3ceb2
Rollup merge of #55901 - euclio:speling, r=petrochenkov
fix various typos in doc comments
2018-11-15 11:04:42 +01:00
Andy Russell
4e35cbb22e
fix various typos in doc comments 2018-11-13 14:45:31 -05:00
kennytm
a8bcf612d5
Rollup merge of #55754 - spastorino:fix-process-output-docs, r=alexcrichton
Avoid converting bytes to UTF-8 strings to print, just pass bytes to stdout/err

r? @nikomatsakis
2018-11-13 19:20:18 +08:00
Santiago Pastorino
3b3b60ce6e
Avoid converting bytes to UTF-8 strings to print, just pass bytes to stdout/err 2018-11-10 14:16:04 -03:00
OCTronics
0b82e03a88 Documents From implementations for Stdio
Add a basic summary and an example to From `ChildStdin`, `ChildStdout`,
`ChildStderr`, `File` implementations.
2018-10-24 22:02:32 +02:00
Jack O'Connor
0945b74d73 document the platform-specific behavior of Command::current_dir 2018-08-20 17:02:45 -04:00
Havvy (Ryan Scheel)
0070b46626 Fix indent 2018-08-11 13:02:49 -07:00
Ryan Scheel
53d308fdf8 Show that Command can be reused and remodified
The prior documentation did not make it clear this was possible.
2018-08-11 05:26:12 -07:00
ljedrz
560d8079ec Deny bare trait objects in src/libstd. 2018-07-10 20:35:36 +02:00
kennytm
cefdd6d5e9
Rollup merge of #49461 - andreastt:child-kill-exited, r=Mark-Simulacrum
std: Child::kill() returns error if process has already exited

This patch makes it clear in std::process::Child::kill()'s API
documentation that an error is returned if the child process has
already cleanly exited.  This is implied by the example, but not
called out explicitly.
2018-04-24 11:56:59 +08:00
Andreas Tolfsen
bc4bd5642a fixup! std: Child::kill() returns error if process has already exited 2018-04-17 08:00:48 +01:00
Andreas Tolfsen
fd2afa01aa fixup! std: Child::kill() returns error if process has already exited 2018-04-08 16:20:15 +01:00
Alex Crichton
323f808791 std: Inline some Termination-related methods
These were showing up in tests and in binaries but are trivially optimize-able
away, so add `#[inline]` attributes so LLVM has an opportunity to optimize them
out.
2018-04-05 11:07:19 -07:00
Thayne McCombs
9ab5788e0e Fix "since" version for getpid feature.
It was stabilized right before the beta branch was cut for 1.26.0.

See https://github.com/rust-lang/rust/pull/49523#issuecomment-377996315
2018-04-02 19:34:06 -06:00
Thayne McCombs
d4f5e89ee0 Stabilize std::process::id()
Fixes #44971
2018-04-01 21:40:56 -06:00
Andreas Tolfsen
51dc6304e7 fixup! std: Child::kill() returns error if process has already exited 2018-03-29 18:10:40 +01:00
Andreas Tolfsen
d541282d6c fixup! std: Child::kill() returns error if process has already exited 2018-03-28 23:05:51 +01:00
Andreas Tolfsen
7eb9a091f3 std: Child::kill() returns error if process has already exited
This patch makes it clear in std::process::Child::kill()'s API
documentation that an error is returned if the child process has
already cleanly exited.  This is implied by the example, but not
called out explicitly.
2018-03-28 18:54:34 +01:00
Alexander Ronald Altman
f9661126ca Minor formatting consistency fix. 2018-03-25 01:27:45 -05:00
Tyler Mandry
2b13d95da0 termination_trait: Make error message more helpful 2018-03-21 23:28:48 -05:00
Tyler Mandry
b6934c91b2 termination_trait: Put examples in error help, not label 2018-03-21 13:32:46 -05:00
Tyler Mandry
94bdeb64f9 termination_trait: Add () example to error message 2018-03-21 00:26:00 -05:00
Scott McMurray
74c5c6e6cb Move process::ExitCode internals to sys
Now begins the saga of fixing compilation errors on other platforms...
2018-03-03 18:44:44 -08:00
Scott McMurray
2ce2b40ee5 Fix linkchecker 2018-02-28 23:34:20 -08:00
Scott McMurray
fc2e4e7833 Put some thought and documentation effort into process::ExitCode 2018-02-27 10:31:17 -08:00
Scott McMurray
e20f7b2ea7 Restrict the Termination impls to simplify stabilization
Make a minimal commitment for stabilization.  More impls are likely in future, but are not necessary at this time.
2018-02-24 23:51:08 -08:00
Niko Matsakis
5f1e78f19a move Termination trait to std::process 2018-02-22 17:57:08 -05:00
Corentin Henry
077d3434aa add test checking that process::Command is Send 2018-01-26 08:21:58 -08:00
Ed Schouten
d9d97c9f09 Make tests build on CloudABI.
There are some tests that need to be disabled on CloudABI specifically,
due to the fact that the shims cannot be built in combination with
unix::ext or windows::ext. Also improve the scoping of some imports to
suppress compiler warnings.
2018-01-11 11:28:34 +01:00
Loïc Damien
8fc4a24062
Fix an error in std::process documentation 2018-01-04 22:01:57 +01:00
kennytm
4ababefc55 Rollup merge of #46943 - malbarbo:process-test-busybox, r=alexcrichton
Fix process test when using busybox mkdir

busybox mkdir . returns 0
busybox mkdir ./ returns 1
2017-12-26 15:18:59 +08:00
Diggory Blake
ccc91d7b48 Capture environment at spawn 2017-12-24 14:24:31 +00:00
Marco A L Barbosa
dc71cab4df Fix process test when using busybox mkdir
busybox mkdir . returns 0
busybox mkdir ./ returns 1
2017-12-22 08:21:05 -02:00
Corey Farwell
2178e3a1b9 Clarify stdin behavior of Command::output.
Fixes #44929.
2017-11-22 20:47:31 -05:00
bors
7d475a28df Auto merge of #45295 - Technius:docs/process, r=steveklabnik
Improve std::process module docs

Addresses part of #29370

I've changed the first `cat` example to a "Hello World" example involving echo, and I've also added another example showing how to pipe output. I'm still working on the module-level description.

For now, I'd like feedback on the examples.

r? @steveklabnik
2017-10-29 06:24:20 +00:00
Bryan Tan
84ab6aec43 Add no_run to process examples involving unix commands 2017-10-28 20:27:05 -07:00
kennytm
bea6136b4a Rollup merge of #45059 - tmccombs:pid, r=alexcrichton
Add current_pid function

Fixes #44971
2017-10-26 03:02:48 +08:00
steveklabnik
f8f9005e57 Fix most rendering warnings from switching to CommonMark 2017-10-20 15:29:35 -04:00
Bryan Tan
3566832ef3 Add child process IO handling docs 2017-10-17 17:49:02 -07:00
kennytm
18f289559e Rollup merge of #45151 - Pirh:stdio_default_docs, r=frewsxcv
Document defaults for stdin, stdout, and stderr methods of Command

For #29370
2017-10-17 22:20:57 +08:00
Bryan Tan
f67f6622b3 Create section on how to spawn processes; change module description 2017-10-15 19:45:07 -07:00
Bryan Tan
bb74b13b74 Fix std::process hello world example 2017-10-15 13:11:14 -07:00
kennytm
430ac4ba50 Rollup merge of #45113 - Pirh:process_output_links, r=steveklabnik
Link std::process::Output to Command and Child

As per #29370
2017-10-15 14:21:51 +08:00
Bryan Tan
e788e90bad Fixed accidental deletion of colon 2017-10-14 20:41:58 -07:00
Bryan Tan
5243a98b48 Add a brief description and two examples to std::process 2017-10-14 19:19:19 -07:00
Pirh
8c4a68dca1 Add line break after summary of process::Output 2017-10-13 18:18:09 +01:00
Pirh
210c91100f Remove misleading line on Windows Subsystem stdio 2017-10-10 17:58:13 +01:00