envy
envy copied to clipboard
variable as Vec<PathBuf> where paths could contain commas?
The readme says that it supports parsing into Vec by separating the values by commas.
If I want to parse a variable as Vec<PathBuf>
where each path could contain commas, would it work by putting that path in single quotes?
E.g.
FOLDERS='C:\Foo,Bar',D:\Baz
resulting in vec![r"C:\Foo,Bar", r"D:\Baz"]
?
And if there is a space after the separating comma, it won't work, right?
Hi @Boscop thanks for reaching out. Very interesting usecase.
Envy leverages a type called IntoDersializer to deserialize spefic types. Without looking closely I would have believe types that derive deserialize may get this for free. I see an impl of derialize for pathbuf here
I don't have tests for values containing commas for types derserializing into vecs so this may be a blindspot in the crate.
I think it's a solvable problem though. I'll take a look. Let me know if you have ideas.
I've used PathBuf
with envy before, but the question is mainly about how to separate them with commas when some values can contain commas. It would also apply to Vec<String>
etc.