fd icon indicating copy to clipboard operation
fd copied to clipboard

exclude and absolute path as argument

Open Germano0 opened this issue 1 year ago • 2 comments

Hello, I have noticed that --exclude flag does not accept an absolute path as argument. Indeed

both commmands

$ pwd
/home/user
fd --hidden --exclude /home/user/beta kate
fd --hidden --exclude=/home/user/beta kate

were still searching /home/user/beta. I have noticed that because such path is a SSHFS remote mount and I could notice activity on such path. To make sure fd was not searching inside such path I had to use the relative name

fd --hidden --exclude beta kate
fd --hidden --exclude=beta kate

I think it would be nice to be able to use absolute path too. Thank your for your work on fd and have a nice day

Germano0 avatar Jun 25 '24 12:06 Germano0

I'm new to the project, and would like to work on this feature request if it's still open.

l-armstrong avatar Jul 08 '24 17:07 l-armstrong

So the patrern passed to --exclude is interpreted similar to a gitignore pattern. That means that if it starts with a "/", then it is relative to the root search path.

So to support this, we would probably need a new option.

tmccombs avatar Jul 09 '24 14:07 tmccombs