Skip to content
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

std.process documentation really needs work #3981

Open
dlangBugzillaToGithub opened this issue Feb 17, 2020 · 0 comments
Open

std.process documentation really needs work #3981

dlangBugzillaToGithub opened this issue Feb 17, 2020 · 0 comments

Comments

@dlangBugzillaToGithub
Copy link

Manu reported this on 2020-02-17T06:18:53Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=20584

Description

I have spent about an hour reading the std.process documentation and messing around, but I can't make heads or tails of it.

I'm trying to work out how to spawn a process and manage the input/output streams.
There appear to be functions that are made for this, but the docs are confusing and examples are not helpful.

Consider `executeShell`, it returns `auto`, which appears to be an object, but who knows what members it has? It has at least `status` and `output`... but how do I get the stderr stream which it says it also captures?

I don't think any function in the std lib should ever return `auto`, it's hostile to documentation.

Looking at the source code, it's not easy to follow at all.

pipeProcess, which looks like it might help me, another `auto` result, and the examples are weird; it looks like it waits for the program to finish on scope exit, but it scrapes the stdout and stderr streams while the program is still running (and may not be finished?)

I am getting almost no value out of anything in this whole doco. Someone should consider it from a what-a-user-wants-to-achieve point of view, make useful examples, and get rid of the `auto`s in the api.

I should have spent seconds on this task, but I've been staring at it for hours, and it's still not clear what I'm supposed to do.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant