Skip to content

Commit

Permalink
Merge pull request #1663 from tmccombs/more-troubleshooting
Browse files Browse the repository at this point in the history
docs: Mention --full-path in troubleshooting
  • Loading branch information
tmccombs authored Jan 28, 2025
2 parents 86d6e2d + 8c17756 commit 564a615
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ use the options `-u`/`--unrestricted` option (or `-HI` to enable hidden and igno
> fd -u …
```

Also remember that by default, `fd` only searches based on the filename and
doesn't compare the pattern to the full path. If you want to search based on the
full path (similar to the `-path` option of `find`) you need to use the `--full-path`
(or `-p`) option.

### Colorized output

`fd` can colorize files by extension, just like `ls`. In order for this to work, the environment
Expand Down
2 changes: 1 addition & 1 deletion src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn print_trailing_slash<W: Write>(
config: &Config,
style: Option<&Style>,
) -> io::Result<()> {
if entry.file_type().map_or(false, |ft| ft.is_dir()) {
if entry.file_type().is_some_and(|ft| ft.is_dir()) {
write!(
stdout,
"{}",
Expand Down
2 changes: 1 addition & 1 deletion src/walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ impl WorkerState {
&& path
.symlink_metadata()
.ok()
.map_or(false, |m| m.file_type().is_symlink()) =>
.is_some_and(|m| m.file_type().is_symlink()) =>
{
DirEntry::broken_symlink(path)
}
Expand Down

0 comments on commit 564a615

Please sign in to comment.