path-convert: non-canonicalized arguments are now passed through correctly
This commit is contained in:
parent
2d88ac6f45
commit
b204c440e2
3 changed files with 9 additions and 4 deletions
|
@ -11,7 +11,11 @@
|
|||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
utility converts UNIX paths to DOS, for command substituting paths when invoking Windows executables from the terminal in WSL. Its options are as follows:
|
||||
utility converts UNIX paths to DOS, for command substituting paths when invoking Windows executables from the terminal in WSL.
|
||||
.Pp
|
||||
Arguments that fail to canonicalize will be passed through as-is.
|
||||
.Pp
|
||||
Its options are as follows:
|
||||
.Bl -tag -width Ds
|
||||
.It Fl h , Fl -help
|
||||
Displays a short help text.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "path-convert"
|
||||
version = "0.0.6"
|
||||
version = "0.0.7"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
|
|
@ -42,11 +42,12 @@ pub fn main() {
|
|||
|
||||
// canonicalize; windows doesn't recognize symlinks
|
||||
let path = Path::new(&target).canonicalize();
|
||||
let mut output =
|
||||
let mut output: String =
|
||||
if let Ok(canonical) = path {
|
||||
canonical.to_string_lossy().to_string()
|
||||
} else {
|
||||
target
|
||||
println!("{quotes}{target}{quotes}");
|
||||
continue;
|
||||
};
|
||||
|
||||
// handle no-space flag
|
||||
|
|
Loading…
Reference in a new issue