sharkdp / fd

A simple, fast and user-friendly alternative to 'find'
Apache License 2.0
33.95k stars 813 forks source link

Option --path-separator does not work on pattern with --full-path #607

Closed claudetete closed 4 years ago

claudetete commented 4 years ago

Describe the bug you encountered: On MS Windows, so with backslash as path separator but using git bash, with following directory tree:

./folder/
./folder/foo
./anotherfolder/
./anotherfolder/folder/
./anotherfolder/folder/bar
$ fd --path-separator="//" --full-path --type f '.*/folder/.*'

does not return any results

$ fd --path-separator="//" --full-path --type f '.*\\folder\\.*'
anotherfolder/folder/bar
folder/foo

Describe what you expected to happen: --path-separator should operate on pattern when using with --full-path

What version of fd are you using?

fd 8.1.1

Which operating system / distribution are you on? Windows: Windows Server 2008 or Windows 10 (with git bash but also tested with cmd)

Since #429, which is a relief to use fd on MS Windows with git bash, thanks a lot !

sharkdp commented 4 years ago

Thank you for reporting this.

~I haven't looked into the details, but could this be related to #537?~ probably not.

reima commented 4 years ago

I don't think this is specific to Windows only. --path-separator currently only replaces the separator when printing file paths, not when matching.

@sharkdp Should the --path-separator also be applied when matching? As it is currently documented, it should only affect the output: "Set the path separator to use when printing file paths." [emphasis mine]

sharkdp commented 4 years ago

@reima Yes, I agree. It's not really a bug so far. The question would be if it would be good for Windows users (and more intuitive?) to support this for matching as well.

sharkdp commented 4 years ago

Closing this for now. Not clear if anything should be changed.