-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding nicer (shell-compatible) Path display here #98
Comments
(Of course |
Thanks. I think this should not live in Camino itself — and it's quite straightforward (most of the complexity is in shell quoting which is delegated) so maybe just have it as a code snippet you can copy-paste around? |
Though maybe this can be an optional displayer enabled by a feature on camino, hmm. |
Yeah, I hesitated before filing the issue here as I couldn't say it was obviously right here, but I don't think it's obviously wrong either...and I think there's maybe some argument this could reach a point where it could be in
Well, if it comes to that I'd probably stick it in my crate https://github.com/coreos/cap-std-ext/ which is somewhat of a grab-bag already and is already used in the places I'd want this, mostly. But, it (and cap-std) I think is less widely used than camino, which is of course way less used than std.
Do you mean the A question for you though is: Do you see the value in this? Would you prefer it in some projects that you maintain today vs how you may print filenames currently? |
This is only tangentially related to this repository, but
I recently wrote this code: https://github.com/containers/bootc/blob/73de2a8ef0a312243b686c6bd2c91413ee725c05/utils/src/path.rs#L31
One of the annoying things about dealing with
std::path::Path
(as opposed toUtf8Path
of course) is that printing them requires going via debug formatting, and it looks ugly (IMO).The idea of that little helper struct is to print paths nicely by default where possible, but fall back to shell quoting if not.
Are you aware of something in the crates.io ecosystem for this? (I didn't see anything here but it's hard to search).
WDYT about adding this to caminio?
The text was updated successfully, but these errors were encountered: