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

Missing Command::get_{args,envs} #4285

Closed
alecmocatta opened this issue Nov 27, 2021 · 5 comments
Closed

Missing Command::get_{args,envs} #4285

alecmocatta opened this issue Nov 27, 2021 · 5 comments
Assignees
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-process Module: tokio/process

Comments

@alecmocatta
Copy link

Tokio's std::process::Command wrapper, tokio::process::Command, is missing Command::get_args and Command::get_envs.

Can be worked around in my case, but would be great to have parity here. Bumped into this porting some code to tokio.

@alecmocatta alecmocatta added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Nov 27, 2021
@ipetkov ipetkov added the M-process Module: tokio/process label Nov 28, 2021
@ipetkov ipetkov self-assigned this Nov 28, 2021
@ipetkov
Copy link
Member

ipetkov commented Nov 28, 2021

Thanks for the report! I'll try to take a look at this when I'm back from vacation next week.

If anyone wants take a shot at implementing it, feel free to ping me on the PR!

@Yogaflre
Copy link

It looks like it's unstable yet.
rust-lang/rust#44434

@alecmocatta
Copy link
Author

It looks like it's unstable yet. rust-lang/rust#44434

Good point, though it's scheduled for stabilisation in a couple days' time: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1570-2021-12-02

@ipetkov
Copy link
Member

ipetkov commented Dec 2, 2021

Unfortunately, our MSRV policy requires that we support compilers from at least 6 months back, meaning we won't be able to rely on these methods from the stdlib for 6 months... :(

I've opened #4295 to add a cmd.as_std() method which will allow the caller to access the underlying std::process::Command, and therefore the new methods (if their stdlib version is new enough)

@ipetkov
Copy link
Member

ipetkov commented Dec 15, 2021

@alecmocatta #4295 has landed in 1.15.0 so I'm going to resolve this for now. Feel free to reopen if you have other issues or questions!

@ipetkov ipetkov closed this as completed Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-process Module: tokio/process
Projects
None yet
Development

No branches or pull requests

3 participants