Add a method to reset the arguments to `std::process::Command`
Open
Nobody has claimed this yet.
T-libs
- Dominant language
- Markdown
- Stars
- 6.6k
- Forks
- 1.7k
- Avg merge
- 16h 14m
- Merged PRs (30d)
- 1
Description
It would be cool if this struct has an option to reset all the current arguments, this would be useful fo example here:
use std::{
io::Result,
process::{Child, Command},
};
pub fn get_killer() -> Box<dyn FnMut(&str) -> Result<Child>> {
let is_windows = cfg!(target_os = "windows");
let mut cmd = Command::new(if is_windows { "cmd" } else { "pkill" });
Box::new(move |program| {
cmd.reset_args(); // removing previous args from previous closure calls
if is_windows {
cmd.args(["taskkill", "/IM", program, "/F"]);
} else {
cmd.arg(program);
}
cmd.spawn()
})
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked std::process::Command documentation and the example in this issue to understand the requested argument-reset behavior. Done means reaching agreement on the API and its semantics for removing previously added arguments; no implementation files or tests are named in the payload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100