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

Support changing the Command program #13

Open
Popog opened this issue Mar 21, 2019 · 1 comment
Open

Support changing the Command program #13

Popog opened this issue Mar 21, 2019 · 1 comment

Comments

@Popog
Copy link

Popog commented Mar 21, 2019

Since Command mostly adheres to a builder pattern, and spawn can be called multiple times, it would be useful to change the program.

Motivating example: a user wants to fall back to an less common filename or path in the case of a failure to spawn.

Proposed signature would look:
pub fn program<S: AsRef<OsStr>>(&mut self, program: S) -> &mut Command

Calling program would imply calling arg0.

It doesn't look like the effected filename has a whole lot of other implications to worry about.

I could put together a PR for this if you're interested.

@tailhook
Copy link
Owner

tailhook commented Aug 5, 2020

Sorry for late reply. I somehow missed the notification. Looks good! Feel free to make PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants