Add a new `-l`/`--list` option to show more details about the search results. This is basically
an alias for `--exec-batch ls -l` with some additional `ls` options.
This can be used in order to:
* see metadata like permissions, owner, file size, modification times (#491)
* see symlink targets (#482)
* achieve a deterministic output order (#324, #196, #159)
* avoid duplicate search results when multiple search paths are given (#405)
This new option can be used instead of piping to `head -n <count>` for
improved performance:
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|:---|---:|---:|---:|---:|
| `fd --max-buffer-time=0 flow.yaml` | 153.9 ± 2.5 | 151.3 | 170.3 | 4.21 ± 5.86 |
| `fd --max-buffer-time=0 flow.yaml \| head -n 1` | 145.3 ± 17.4 | 111.0 | 180.2 | 3.98 ± 5.55 |
| `fd --max-results=1 flow.yaml` | 36.5 ± 50.8 | 7.2 | 145.7 | 1.00 |
Note: there is a large standard deviation on the last result due to the
non-deterministic file system traversal. With `--max-results`, we don't
have to traverse the whole filesystem tree, so it's all about luck.
closes#472closes#476
This adds a `--same-file-system` CLI option that instructs the walker to
not cross file system boundaries.
Due to the fact that the corresponding option of the `ignore` crate's
`WalkBuilder` does not support platforms other than Unix and Windows,
the option does nothing on platforms other than those.
Resolves#507
Use my new [lscolors](https://github.com/sharkdp/lscolors) crate instead
of the internal `lscolors` module
- Speeds up `LS_COLORS` querying, leading to a nice 25% performance
improvement when
- Adds support for 24-bit colors and background colors
closes#368closes#363
* Multiple `--search-path` arguments can be supplied which replace the positional `path` argument for providing directories which will be searched.
* When a `--search-path` argument is provided, positional `path` arguments will not be allowed
This PR splits `internals.rs` into the `internal` module with multiple
files, and moves `FdOptions` into `opts.rs`.
The main motivation behind this is to move logic for constructing
`FdOptions` out of the main function and more readable and easier to
understand in the `opts` module. The goal will eventually to be able
to write `FdOptions::from(matches)` and have the options constructed.
Previously, the constants defined in `src/exit_codes` weren't being
used, and the constants for exit codes were being redefined in the
`internals` module.
This PR removes the exit code consts and instead uses an enum defined in
`src/exit_codes`. This centralizes the definitions of exit codes making
them easier to modify and keep track of.
For muscle memory compatibility with `rg`. This variant will not show in
the help or in the program options, and is only checked if `--maxdepth`
is not specified.
Add a new `empty`/`e` type to search for empty files and/or directories.
To search for both empty files and directories, use one of the
following:
fd --type empty
fd -te
fd --type empty --type file --type directory
To search for empty files, use
fd --type empty --type file
fd -te -tf
To search for empty directories, use
fd --type empty --type directory
fd -te -td
closes#273