Skip to content

[Bug] find_args not applied correctly when using fd/fdfind #806

@ray-x

Description

@ray-x

#86

Issue existed in 2.x branch

Suppose I using this setup

{
  ...
    filesystem = {
      find_command = "fd", -- this is determined automatically, you probably don't need to set it
      find_args = { -- you can specify extra args to pass to the find command.
        fd = {
          '--exclude',
          '.git',
          '--exclude',
          'node_modules',
          '--exclude',
          'site-packages',
          '--exclude',
          'vendor',
        },
      },
   },
   ...
}

When expanded the arguments (search ses) , the arguments are

 { "--hidden", "--no-ignore", "--color", "never", "--max-results", 50, 
"--glob", "--", "*ses*", "/home/ray/Downloads", "--exclude", ".git", 
"--exclude", "node_modules", "--exclude", "site-packages", 
"--exclude", "vendor" }

Which is incorrect
It should be

 { "--hidden", "--no-ignore", "--color", "never", "--max-results", 50, 
"--exclude", ".git", "--exclude", "node_modules", "--exclude",
"site-packages", "--exclude", "vendor"  "--glob", "--", "*ses*",  
"/home/ray/Downloads"}

The position of -- is incorrect.
For most shell command we can not add any arguments start with - after --.

Also, another issue is

        hide_gitignored = false,

I want to show files ignored by git. But this setup adds "--no-ignore", this option ignores .gitignore, .git/info/exclude, .ignore and .fdignore setup. In my setup, those ignored files are different.
I would suggest adding fd_no_ignore

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions