Currently I see no way to pass in an OsStr as an argument to a shell function.
The big benefit I see to the current way is that it allows a shell function to take any type that is Display, which is certainly a nice property to have. But it also prevents you from passing in values that are not valid UTF-8.
The best option that I see would be to add an osstr option, e.g.
#[shell(osstr)]
to change the requirement of the arguments to be AsRef<OsStr> instead of ToString. (Maybe per field would be better.)
The alternative I see would be to define a new trait for this case, but that's inconvenient without trait specialization.
Currently I see no way to pass in an OsStr as an argument to a shell function.
The big benefit I see to the current way is that it allows a shell function to take any type that is Display, which is certainly a nice property to have. But it also prevents you from passing in values that are not valid UTF-8.
The best option that I see would be to add an osstr option, e.g.
to change the requirement of the arguments to be
AsRef<OsStr>
instead ofToString
. (Maybe per field would be better.)The alternative I see would be to define a new trait for this case, but that's inconvenient without trait specialization.
Thoughts?