matklad / xshell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README clarification about cross-platform

hoijui opened this issue · comments

xshell provides a set of cross-platform utilities for writing ergonomic "bash" scripts

when I see bash in quotes, and read cross-platform, and know it is doing this stuff from within rust, my mind tells me:

Oh, this must use a rust-native reimplementation of common *NIX shell utilities

But reading more, I get the idea that... it is something else, and running "sed -e ..." with this tool on windows would fail on a bare windows without extra BASH utilities installed, for example.
Thus, I would like to see this clarified in the README and docs - in what way is this cross-platform?

That’s the right intuition! We don’t have sed, but we do have more basic stuff like cd, cp, rm, etc: https://docs.rs/xshell/0.1.17/xshell/#functions

Adding something like sed is totally in scope for xshell. Although in this specific case, I’d say that probably writing usual Rust code withregex would be ergonomic enough.

The bash is in quotes because, rather than providing a literal POSIX-compatible environment, we provide whatever is needed to get a similar feeling.

oh wow.... OK! :-)
then.. all good I guess.. thank you!
and.. cool! :-)
..and indeed.. rust regex makes more sense then sed.