pub fn set_list_with_options<K: AsRef<OsStr>>(
key: K,
values: &Vec<String>,
options: &ListOptions,
)Expand description
Sets the provided string vector as an environment variable.
§Arguments
key- The environment variable namevalues- String vector of valuesoptions- See ListOptions
§Example
fn main() {
let mut options = envmnt::ListOptions::new();
options.separator = Some(",".to_string());
envmnt::set_list_with_options(
"LIST_TEST_ENV",
&vec!["1".to_string(), "2".to_string(), "3".to_string()],
&options,
);
let values = envmnt::get_list_with_options("LIST_TEST_ENV", &options).unwrap();
println!("List Values: {:?}", values);
let same = envmnt::is_equal("LIST_TEST_ENV", "1,2,3");
println!("Same: {}", same);
}