oconnor663 / duct.rs

a Rust library for running child processes
MIT License
819 stars 34 forks source link

unset without full_env? #39

Closed oconnor663 closed 6 years ago

oconnor663 commented 7 years ago

You might want to express something like "the variable $FOO must not be set for this expression, but any other variables given as outer env calls are fine." That's not currently possible, because full_env will stomp on any outer env calls.

The usual solution will be "just fold those outer env calls into the map you're giving to full_env." However, there might be some rare cases where you don't control the code calling full_env? Unlikely, but if there was an API that satisfied all possible use cases that would be cool :)

oconnor663 commented 7 years ago

Maybe worth adding an explicit unset_env method? That could also save trouble for callers who only want to unset one thing, and who don't want to go through the trouble of building up the entire env map. Could be worth it...