coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

rm: bug with trailing backslash on windows

Open amrbashir opened this issue 3 years ago • 3 comments

I have a bad habit of providing options at the end of the command:

rm .\some-directory\ -rf

and since I use Tab to autocomplete the path in powershell, it will add trailing backslash, and will interpret the -rf as part of the path.

rm: cannot remove '.\some-directory\ -rf': No such file or directory

It works fine if I removed the trailing backslash.

amrbashir avatar Feb 27 '22 23:02 amrbashir

tried to track this down a bit, and it looks like it is an issue with using clap::App::get_matches_from with wild::args_os(). using clap::App::get_matches() parses the args correctly. Not sure how to continue further.

amrbashir avatar Mar 04 '22 12:03 amrbashir

Opened an upstream issue https://gitlab.com/kornelski/wild/-/issues/7

amrbashir avatar Apr 03 '22 13:04 amrbashir

@amrbashir Thank you! Let's hope it gets fixed!

tertsdiepraam avatar Apr 04 '22 22:04 tertsdiepraam