Closed as not planned
Description
Feature gate: #![feature(mutate_command_args)]
This is a tracking issue for adding an API to mutate the arguments of std::process::Command.
Discussed earlier in https://internals.rust-lang.org/t/lack-of-api-mutating-args-at-std-command/14908
Public API
// std::process::Command
pub fn args_clear(&mut self) -> &mut Command;
pub fn arg_set<S>(&mut self, index: usize, value: S) -> &mut Command
where
S: AsRef<OsStr>;
// maybe for convenience (same as .args_clear().args(new_args)):
pub fn args_new<I, S>(&mut self, args: I) -> &mut Command
where
I: IntoIterator<Item = S>,
S: AsRef<OsStr>;
arg_set()
may panic when the index is out of range, only existing elements get replaced.
Steps / History
- Implementation:
- Unix Implementation
- Other Platforms
- Final comment period (FCP)
- Stabilization PR
Unresolved Questions
- None yet.