Compare commits

...

1894 Commits

Author SHA1 Message Date
Thayne McCombs cdea7f5633 Merge pull request #1943 from tmccombs/archive-script
build: Create archive script
2026-08-27 23:52:23 -06:00
Thayne McCombs fe0e455fee Merge pull request #2102 from tmccombs/changelog-update
chore: Update version in CHANGELOG
2026-08-26 09:54:02 -06:00
Thayne McCombs a89e394a0d chore: Update version in CHANGELOG 2026-08-26 02:12:47 -06:00
Thayne McCombs 4f81778774 Merge pull request #2101 from tmccombs/release-10.5.0
chore: Bump to version 10.5.0
2026-08-26 01:54:19 -06:00
Thayne McCombs 711ba7fe67 chore: Buimp to version 10.5.0 2026-08-26 01:27:33 -06:00
Thayne McCombs c276ac79f4 build: Create archive script
Move the code for creating the archive from the GHA yaml into a
dedicated script file.
2026-08-26 01:00:44 -06:00
Thayne McCombs ee20f426dd Merge pull request #2091 from sharkdp/dependabot/github_actions/actions/attest-4.2.1
build(deps): bump actions/attest from 4.2.0 to 4.2.1
2026-08-09 01:42:46 -06:00
Thayne McCombs 0b10bf2665 Merge pull request #2086 from sharkdp/dependabot/cargo/crossbeam-channel-0.5.16
build(deps): bump crossbeam-channel from 0.5.15 to 0.5.16
2026-08-09 01:37:12 -06:00
Thayne McCombs aaecbc0a58 Merge pull request #2085 from sharkdp/dependabot/cargo/ignore-0.4.31
build(deps): bump ignore from 0.4.26 to 0.4.31
2026-08-09 01:36:38 -06:00
Thayne McCombs cb4069ec55 Merge pull request #2087 from sharkdp/dependabot/cargo/globset-0.4.19
build(deps): bump globset from 0.4.18 to 0.4.19
2026-08-09 01:35:32 -06:00
Thayne McCombs 69a25907ab Merge pull request #2084 from sharkdp/dependabot/cargo/anyhow-1.0.104
build(deps): bump anyhow from 1.0.102 to 1.0.104
2026-08-09 01:35:00 -06:00
Thayne McCombs 868c3a34e2 Merge pull request #2083 from sharkdp/dependabot/cargo/libc-0.2.189
build(deps): bump libc from 0.2.186 to 0.2.189
2026-08-09 01:32:52 -06:00
Thayne McCombs ee195f4dd6 Merge pull request #2082 from nikolauspschuetz/fix-changed-time-overflow-panic
Fix panic on out-of-range '@' Unix timestamp in time filters
2026-08-09 01:32:07 -06:00
Thayne McCombs 0f1f9676dc Merge pull request #2068 from tmccombs/fix-clippy
fix: New clippy warnings
2026-08-06 10:54:59 -06:00
dependabot[bot] 2bb2e2b954 build(deps): bump actions/attest from 4.2.0 to 4.2.1
Bumps [actions/attest](https://github.com/actions/attest) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/actions/attest/releases)
- [Changelog](https://github.com/actions/attest/blob/main/RELEASE.md)
- [Commits](https://github.com/actions/attest/compare/f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6...508db95dd578ae2727ebd6217d5ba78e4fbda05d)

---
updated-dependencies:
- dependency-name: actions/attest
  dependency-version: 4.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-05 17:43:24 +00:00
dependabot[bot] a62a59dafe build(deps): bump globset from 0.4.18 to 0.4.19
Bumps [globset](https://github.com/BurntSushi/ripgrep) from 0.4.18 to 0.4.19.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/compare/globset-0.4.18...globset-0.4.19)

---
updated-dependencies:
- dependency-name: globset
  dependency-version: 0.4.19
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-01 17:42:57 +00:00
dependabot[bot] 7639bced74 build(deps): bump crossbeam-channel from 0.5.15 to 0.5.16
Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.15 to 0.5.16.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/main/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.15...crossbeam-channel-0.5.16)

---
updated-dependencies:
- dependency-name: crossbeam-channel
  dependency-version: 0.5.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-01 17:42:50 +00:00
dependabot[bot] 51e44c0626 build(deps): bump ignore from 0.4.26 to 0.4.31
Bumps [ignore](https://github.com/BurntSushi/ripgrep) from 0.4.26 to 0.4.31.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/compare/ignore-0.4.26...ignore-0.4.31)

---
updated-dependencies:
- dependency-name: ignore
  dependency-version: 0.4.31
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-01 17:42:41 +00:00
dependabot[bot] 370174528f build(deps): bump anyhow from 1.0.102 to 1.0.104
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.102 to 1.0.104.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.102...1.0.104)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-version: 1.0.104
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-01 17:42:31 +00:00
dependabot[bot] 30fd75b22b build(deps): bump libc from 0.2.186 to 0.2.189
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.186 to 0.2.189.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.189/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.186...0.2.189)

---
updated-dependencies:
- dependency-name: libc
  dependency-version: 0.2.189
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-01 17:42:24 +00:00
Nikolaus Schuetz 5becb9d52c Reject out-of-range '@' Unix timestamp instead of panicking
Use UNIX_EPOCH.checked_add(...) so an out-of-range value returns None
and propagates through the existing ? like every other parse failure in
TimeFilter::from_str, rather than panicking via SystemTime's Add. See #2081.
2026-07-30 08:06:22 -07:00
Nikolaus Schuetz fb0426fed1 Add failing test for out-of-range '@' Unix timestamp
Demonstrates that a '@'-timestamp large enough to overflow SystemTime
panics ('overflow when adding duration to instant') instead of being
rejected like other unparseable time inputs. See #2081.
2026-07-30 08:06:07 -07:00
Thayne McCombs 41532d114e Merge pull request #2075 from cmelaro/fix-readme-example
Update README.md to resolve non-working example.
2026-07-27 09:41:31 -06:00
Chris Melaro 81efb5028c add -u flag to example so it works 2026-07-26 14:24:38 -04:00
Thayne McCombs ca51233d27 Merge pull request #2073 from sharkdp/dependabot/github_actions/actions/checkout-7.0.1
build(deps): bump actions/checkout from 7.0.0 to 7.0.1
2026-07-24 14:22:05 -06:00
Thayne McCombs 3381ab89d7 Merge pull request #2070 from sharkdp/dependabot/github_actions/actions/attest-4.2.0
build(deps): bump actions/attest from 4.1.1 to 4.2.0
2026-07-24 14:21:25 -06:00
dependabot[bot] 5095e95a95 build(deps): bump actions/checkout from 7.0.0 to 7.0.1
Bumps [actions/checkout](https://github.com/actions/checkout) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v7.0.0...v7.0.1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-24 17:42:24 +00:00
dependabot[bot] 5a093fdfd6 build(deps): bump actions/attest from 4.1.1 to 4.2.0
Bumps [actions/attest](https://github.com/actions/attest) from 4.1.1 to 4.2.0.
- [Release notes](https://github.com/actions/attest/releases)
- [Changelog](https://github.com/actions/attest/blob/main/RELEASE.md)
- [Commits](https://github.com/actions/attest/compare/a1948c3f048ba23858d222213b7c278aabede763...f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6)

---
updated-dependencies:
- dependency-name: actions/attest
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-23 17:42:46 +00:00
Thayne McCombs acc64aab12 fix: New clippy warnings 2026-07-23 01:55:04 -06:00
Thayne McCombs eead1886cd Merge pull request #2066 from sharkdp/dependabot/github_actions/softprops/action-gh-release-3.0.2
build(deps): bump softprops/action-gh-release from 3.0.1 to 3.0.2
2026-07-23 01:47:36 -06:00
dependabot[bot] fed92120af build(deps): bump softprops/action-gh-release from 3.0.1 to 3.0.2
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/718ea10b132b3b2eba29c1007bb80653f286566b...3d0d9888cb7fd7b750713d6e236d1fcb99157228)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 3.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-20 17:42:43 +00:00
Thayne McCombs 1bfeea237a Merge pull request #2063 from kobihikri/docs-msrv
docs: update required Rust version in README to match Cargo.toml MSRV (1.77.2 -> 1.90.0)
2026-07-15 14:22:25 -06:00
Thayne McCombs 369a71a4c5 Merge pull request #2064 from WilliamLeony/fix-readme-bash-fence
Fix inconsistent code fence language in README.md
2026-07-15 14:19:06 -06:00
William Leony cd755e284c Fix inconsistent code fence language in README.md
The checksum example under 'Command execution' was missing the
'bash' language tag on its opening fence, unlike every other shell
example in the file, so it didn't get syntax highlighting.
2026-07-15 16:06:42 -03:00
Kobi Hikri 372584e760 docs: update required Rust version in README (1.77.2 -> 1.90.0, matching Cargo.toml rust-version) 2026-07-15 13:28:38 +03:00
Thayne McCombs 5a5852e15b Merge pull request #2052 from sharkdp/dependabot/github_actions/actions/attest-4.1.1
build(deps): bump actions/attest from 4.1.0 to 4.1.1
2026-07-07 02:00:22 -06:00
Thayne McCombs dda13cccf6 Merge pull request #2047 from sharkdp/dependabot/cargo/nix-0.31.3
build(deps): bump nix from 0.31.2 to 0.31.3
2026-07-06 07:19:29 -06:00
Thayne McCombs aa41f342b5 Merge pull request #2050 from sharkdp/dependabot/cargo/jiff-0.2.29
build(deps): bump jiff from 0.2.27 to 0.2.29
2026-07-04 23:39:02 -06:00
Thayne McCombs cffed27a2e Merge pull request #2049 from sharkdp/dependabot/cargo/regex-1.12.4
build(deps): bump regex from 1.12.3 to 1.12.4
2026-07-04 23:37:52 -06:00
Thayne McCombs 6b5d1ac9d6 Merge pull request #2048 from sharkdp/dependabot/cargo/ignore-0.4.26
build(deps): bump ignore from 0.4.25 to 0.4.26
2026-07-04 23:37:22 -06:00
dependabot[bot] 7d93f3adc7 build(deps): bump actions/attest from 4.1.0 to 4.1.1
Bumps [actions/attest](https://github.com/actions/attest) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/actions/attest/releases)
- [Changelog](https://github.com/actions/attest/blob/main/RELEASE.md)
- [Commits](https://github.com/actions/attest/compare/59d89421af93a897026c735860bf21b6eb4f7b26...a1948c3f048ba23858d222213b7c278aabede763)

---
updated-dependencies:
- dependency-name: actions/attest
  dependency-version: 4.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-03 17:42:31 +00:00
Thayne McCombs fb1486f210 Merge pull request #1905 from tmccombs/release-automation
Add a little more automation for the release
2026-07-01 13:27:06 -06:00
dependabot[bot] 0c9c101e21 build(deps): bump jiff from 0.2.27 to 0.2.29
Bumps [jiff](https://github.com/BurntSushi/jiff) from 0.2.27 to 0.2.29.
- [Release notes](https://github.com/BurntSushi/jiff/releases)
- [Changelog](https://github.com/BurntSushi/jiff/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/jiff/commits/jiff-static-0.2.29)

---
updated-dependencies:
- dependency-name: jiff
  dependency-version: 0.2.29
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-01 17:42:52 +00:00
dependabot[bot] 8ff051e801 build(deps): bump regex from 1.12.3 to 1.12.4
Bumps [regex](https://github.com/rust-lang/regex) from 1.12.3 to 1.12.4.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.12.3...1.12.4)

---
updated-dependencies:
- dependency-name: regex
  dependency-version: 1.12.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-01 17:42:44 +00:00
dependabot[bot] daefe07614 build(deps): bump ignore from 0.4.25 to 0.4.26
Bumps [ignore](https://github.com/BurntSushi/ripgrep) from 0.4.25 to 0.4.26.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/compare/ignore-0.4.25...ignore-0.4.26)

---
updated-dependencies:
- dependency-name: ignore
  dependency-version: 0.4.26
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-01 17:42:38 +00:00
dependabot[bot] cade0b5e76 build(deps): bump nix from 0.31.2 to 0.31.3
Bumps [nix](https://github.com/nix-rust/nix) from 0.31.2 to 0.31.3.
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.31.2...v0.31.3)

---
updated-dependencies:
- dependency-name: nix
  dependency-version: 0.31.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-01 17:42:31 +00:00
Thayne McCombs c73e5e58a4 Merge pull request #2045 from tmccombs/io-error-handling
refactor: Get io error from method
2026-07-01 09:03:44 -06:00
Thayne McCombs f898e95db5 refactor: Get io error from method
use `ignore::Error::io_error()` to inspect the `std::io::Error` insted
of pattern matching on `ignore::Error::Io`.

This avoids relying on the implementation of ignore and how it organizes
the error. In particular, this would allow us to handle if the IO error
was wrapped in a `WithDepth`, as would be the case if
BurntSushi/ripgrep#3458 was merged.

This also allows us to remove some duplicate code.
2026-07-01 00:55:42 -06:00
Thayne McCombs b12606438e Merge pull request #1976 from curious-rabbit/master
fix: sanitize escape sequence injection
2026-07-01 00:36:48 -06:00
Thayne McCombs 95dc6454d5 Merge pull request #2037 from parneetsingh022/tests/search-str-for-entry-edge-cases
Add tests for search_str_for_entry without base dir
2026-06-28 23:44:14 -06:00
Thayne McCombs 61c5399fa4 Merge pull request #2036 from greymoth-jp/fix/and-pattern-path-separator
Check --and patterns for path separators too (match #1975)
2026-06-28 23:42:55 -06:00
Thayne McCombs 126be98699 Merge pull request #2038 from sharkdp/dependabot/github_actions/softprops/action-gh-release-3.0.1
build(deps): bump softprops/action-gh-release from 3.0.0 to 3.0.1
2026-06-28 10:56:02 -06:00
Thayne McCombs 77629639ff Merge pull request #2040 from bonanza127/fix-readme-number-format
docs(README): use consistent thousands separator
2026-06-28 02:03:26 -06:00
bonanza127 3ae9c9567e docs(README): use consistent thousands separator
Change ~750.000 to ~750,000 for consistency with English number formatting.
2026-06-28 04:50:55 +09:00
dependabot[bot] 8965502e8a build(deps): bump softprops/action-gh-release from 3.0.0 to 3.0.1
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/b4309332981a82ec1c5618f44dd2e27cc8bfbfda...718ea10b132b3b2eba29c1007bb80653f286566b)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 3.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-26 17:42:37 +00:00
Parneet 86c1e7d30d Add tests for search_str_for_entry without base dir 2026-06-26 16:59:06 +05:30
greymoth-jp 6aac84e4ae fix: flag path separators in --and patterns, not just the primary pattern
The path-separator diagnostic (#1873, made unconditional for the primary
pattern in #1975) only inspected opts.pattern. --and patterns (opts.exprs)
are chained with the primary pattern and matched against the file name in
exactly the same way, so a path separator in any of them is the same silent
"no results" footgun. Factor the per-pattern check into a helper and apply
it to the primary pattern plus every --and pattern, mirroring how
ensure_use_hidden_option_for_leading_dot_pattern already iterates all
patterns. --full-path still suppresses the diagnostic. Adds a regression test.

See #1873.
2026-06-26 17:02:47 +09:00
Thayne McCombs a8a77d2162 Merge pull request #2034 from sharkdp/dependabot/github_actions/actions/checkout-7.0.0
build(deps): bump actions/checkout from 6.0.3 to 7.0.0
2026-06-25 01:13:26 -06:00
dependabot[bot] e8730e6ca3 build(deps): bump actions/checkout from 6.0.3 to 7.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.3 to 7.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6.0.3...v7.0.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-24 17:42:30 +00:00
Thayne McCombs 3b3e328b5c Merge pull request #2032 from sharkdp/dependabot/github_actions/actions/checkout-6.0.3
build(deps): bump actions/checkout from 6.0.2 to 6.0.3
2026-06-18 13:36:42 -06:00
dependabot[bot] fccbe9b1ee build(deps): bump actions/checkout from 6.0.2 to 6.0.3
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6.0.2...v6.0.3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-18 17:42:30 +00:00
Thayne McCombs b5ae476fb1 Merge pull request #2030 from sharkdp/dependabot/github_actions/actions/checkout-6.0.2
build(deps): bump actions/checkout from 6 to 6.0.2
2026-06-18 00:04:19 -06:00
Thayne McCombs 094446004d Merge pull request #2001 from leno23/docs/extension-help-1693
docs: clarify that -e/--extension matches all entry types
2026-06-18 00:03:42 -06:00
wuyangfan 1161471b7e docs: clarify extension filter scope 2026-06-17 10:56:33 +08:00
Thayne McCombs 25461e5ce1 Merge pull request #2029 from sharkdp/dependabot/cargo/clap_complete-4.6.5
build(deps): bump clap_complete from 4.6.2 to 4.6.5
2026-06-06 00:48:49 -06:00
Thayne McCombs f7d4d717c2 Merge pull request #2026 from sharkdp/dependabot/cargo/filetime-0.2.29
build(deps): bump filetime from 0.2.27 to 0.2.29
2026-06-04 10:30:46 -06:00
dependabot[bot] 21facf8832 build(deps): bump clap_complete from 4.6.2 to 4.6.5
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.6.2 to 4.6.5.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.6.2...clap_complete-v4.6.5)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-version: 4.6.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-04 08:10:24 +00:00
Thayne McCombs 8e80bbe721 Merge pull request #2027 from sharkdp/dependabot/cargo/tikv-jemallocator-0.7.0
build(deps): bump tikv-jemallocator from 0.6.1 to 0.7.0
2026-06-04 02:08:22 -06:00
Thayne McCombs b25ca81375 Merge pull request #2028 from sharkdp/dependabot/cargo/normpath-1.5.1
build(deps): bump normpath from 1.5.0 to 1.5.1
2026-06-04 02:07:11 -06:00
dependabot[bot] 5ac75050d1 build(deps): bump normpath from 1.5.0 to 1.5.1
Bumps [normpath](https://github.com/dylni/normpath) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/dylni/normpath/releases)
- [Commits](https://github.com/dylni/normpath/compare/1.5.0...1.5.1)

---
updated-dependencies:
- dependency-name: normpath
  dependency-version: 1.5.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-04 07:15:00 +00:00
Thayne McCombs f72512ff43 Merge pull request #2025 from sharkdp/dependabot/cargo/jiff-0.2.27
build(deps): bump jiff from 0.2.24 to 0.2.27
2026-06-04 01:13:20 -06:00
dependabot[bot] 75527dd9c6 build(deps): bump actions/checkout from 6 to 6.0.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 6.0.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v6.0.2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-03 01:50:25 +00:00
dependabot[bot] 86564cd00d build(deps): bump tikv-jemallocator from 0.6.1 to 0.7.0
Bumps [tikv-jemallocator](https://github.com/tikv/jemallocator) from 0.6.1 to 0.7.0.
- [Release notes](https://github.com/tikv/jemallocator/releases)
- [Changelog](https://github.com/tikv/jemallocator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tikv/jemallocator/compare/0.6.1...0.7.0)

---
updated-dependencies:
- dependency-name: tikv-jemallocator
  dependency-version: 0.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-03 01:49:36 +00:00
dependabot[bot] b955593ac6 build(deps): bump filetime from 0.2.27 to 0.2.29
Bumps [filetime](https://github.com/alexcrichton/filetime) from 0.2.27 to 0.2.29.
- [Commits](https://github.com/alexcrichton/filetime/compare/0.2.27...0.2.29)

---
updated-dependencies:
- dependency-name: filetime
  dependency-version: 0.2.29
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-03 01:49:32 +00:00
dependabot[bot] 1d4fa16433 build(deps): bump jiff from 0.2.24 to 0.2.27
Bumps [jiff](https://github.com/BurntSushi/jiff) from 0.2.24 to 0.2.27.
- [Release notes](https://github.com/BurntSushi/jiff/releases)
- [Changelog](https://github.com/BurntSushi/jiff/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/jiff/commits)

---
updated-dependencies:
- dependency-name: jiff
  dependency-version: 0.2.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-03 01:49:25 +00:00
Thayne McCombs 42b2ab8a84 Merge pull request #1983 from DeflateAwning/feat-exact-i1963
feat: Add --exact argument to match exact filename
2026-05-20 01:26:24 -06:00
Thayne McCombs febc1b692f Merge pull request #2011 from stevenwalton/master
docs: Update Help String
2026-05-18 00:22:07 -06:00
Steven Walton 8f1f55b9da Merge resolution 2026-05-17 18:46:39 -07:00
Steven Walton 2fbecc9bd8 Swap regex and glob, fixing space. 2026-05-17 18:45:39 -07:00
Steven Walton 8fdab04b7a Update src/cli.rs
Co-authored-by: Thayne McCombs <astrothayne@gmail.com>
2026-05-17 18:43:27 -07:00
Thayne McCombs a2d6bea5ac Merge pull request #1984 from tmccombs/comment-ai-policy
docs: Add policy for comments
2026-05-17 13:18:30 -06:00
Thayne McCombs e3a065dfe1 docs: Remove unnecessary phrase
"if you are a non-native English speaker" isn't really needed.
2026-05-17 13:13:16 -06:00
curious-rabbit 66be8485bc fix format 2026-05-17 20:49:47 +02:00
curious-rabbit 7d18db23a7 improve patch 2026-05-17 20:35:00 +02:00
Thayne McCombs d491003759 Merge pull request #2006 from Sean-Kenneth-Doherty/codex/single-dash-search-path
Treat single dash as a literal search path
2026-05-17 12:32:09 -06:00
Steven Walton 4d88708d79 That period shouldn't have been included 2026-05-17 10:13:45 -07:00
Steven Walton 96a8dcd58b docs: Update Help String
Updated help string to clarify that fd respects gitignore by default.
Also added verbage to clarify that globbing and regex patterns are
accepted without a flag.
2026-05-17 10:07:02 -07:00
Sean Doherty f1dd935dea Apply changelog wording suggestion 2026-05-17 09:02:21 -05:00
Tavian Barnes 1cfac9ff7b Merge pull request #1974 from sharkdp/dependabot/github_actions/actions/upload-artifact-7.0.1
build(deps): bump actions/upload-artifact from 7.0.0 to 7.0.1
2026-05-16 23:05:41 -04:00
Tavian Barnes 425d7d9e6b Merge pull request #1987 from sharkdp/dependabot/cargo/libc-0.2.186
build(deps): bump libc from 0.2.183 to 0.2.186
2026-05-16 23:00:57 -04:00
Sean Doherty 8dfa67a245 Treat single dash as search path 2026-05-16 17:15:00 -05:00
wuyangfan 9f938bea1e docs: drop accidental --full-path edits from extension PR
Scope this branch to -e/--extension only (#1693). Full-path help
clarifications remain in #1997.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-17 05:37:07 +08:00
wuyangfan e60582f838 docs: clarify that -e/--extension matches all entry types
Short help stays minimal; long help and man page explain that extension
filtering applies to directories as well unless --type restricts results.

Addresses maintainer feedback on #1922. Fixes #1693

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-17 04:47:24 +08:00
DeflateAwning 9f12a3059c docs: Add --exact to man page 2026-05-14 14:06:02 -06:00
DeflateAwning cb2f37a46a docs: Add --exact to changelog 2026-05-14 14:05:28 -06:00
DeflateAwning d642c446c9 fix: --exact should conflict with --fix-strings 2026-05-14 14:03:44 -06:00
DeflateAwning b77f9b811a test: Should not match substring filenames 2026-05-14 13:59:48 -06:00
curious-rabbit c96398c1bb cleanup 2026-05-05 21:48:32 +02:00
curious-rabbit a00259bf79 optimize 2026-05-05 21:27:25 +02:00
curious-rabbit 9d536e1a40 formatting 2026-05-02 20:56:11 +02:00
curious-rabbit aeecb5d8c0 apply strict filter 2026-05-02 20:52:29 +02:00
Thayne McCombs 7f1b1471d5 Merge pull request #1988 from sharkdp/dependabot/cargo/clap_complete-4.6.2
build(deps): bump clap_complete from 4.6.0 to 4.6.2
2026-05-02 00:49:19 -06:00
Thayne McCombs fe77ab4810 Merge pull request #1989 from sharkdp/dependabot/cargo/clap-4.6.1
build(deps): bump clap from 4.6.0 to 4.6.1
2026-05-02 00:48:55 -06:00
dependabot[bot] a876e69751 build(deps): bump clap_complete from 4.6.0 to 4.6.2
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.6.0 to 4.6.2.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.6.0...clap_complete-v4.6.2)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-version: 4.6.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-02 06:14:32 +00:00
dependabot[bot] a58e1a2467 build(deps): bump clap from 4.6.0 to 4.6.1
Bumps [clap](https://github.com/clap-rs/clap) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.6.0...clap_complete-v4.6.1)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-02 06:14:26 +00:00
Thayne McCombs 5776a05a24 Merge pull request #1986 from sharkdp/dependabot/cargo/jiff-0.2.24
build(deps): bump jiff from 0.2.23 to 0.2.24
2026-05-02 00:13:21 -06:00
dependabot[bot] 8af8db28ed build(deps): bump libc from 0.2.183 to 0.2.186
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.183 to 0.2.186.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.186/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.183...0.2.186)

---
updated-dependencies:
- dependency-name: libc
  dependency-version: 0.2.186
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-01 21:06:00 +00:00
dependabot[bot] 104d0ce4e5 build(deps): bump jiff from 0.2.23 to 0.2.24
Bumps [jiff](https://github.com/BurntSushi/jiff) from 0.2.23 to 0.2.24.
- [Release notes](https://github.com/BurntSushi/jiff/releases)
- [Changelog](https://github.com/BurntSushi/jiff/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/jiff/compare/jiff-static-0.2.23...jiff-static-0.2.24)

---
updated-dependencies:
- dependency-name: jiff
  dependency-version: 0.2.24
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-01 21:05:54 +00:00
curious-rabbit 825f308931 formatting 2026-04-27 12:56:06 +02:00
Thayne McCombs 2250bb0ad1 Merge pull request #1980 from sharkdp/dependabot/github_actions/softprops/action-gh-release-3.0.0
build(deps): bump softprops/action-gh-release from 2.6.1 to 3.0.0
2026-04-24 01:07:53 -06:00
Thayne McCombs a7a67e4998 Merge pull request #1889 from skane-lukas/issue-1888-fix-symlink-bash-completion
Fix symlink for bash completions
2026-04-24 01:00:42 -06:00
DeflateAwning 468c807049 docs: Update suggested non-regex note on regex failure 2026-04-23 15:31:03 -06:00
Thayne McCombs a86e16baa8 docs: Add policy for comments
Specify that comments on PRs should be written by humans
2026-04-23 01:07:42 -06:00
Thayne McCombs 0a3a485bd7 Merge pull request #1967 from tmccombs/pr-expectations
docs: Add PR Expectations
2026-04-23 00:58:15 -06:00
Thayne McCombs 4e2c81277a Merge pull request #1975 from SAY-5/fix/pattern-path-separator-v2
fix: flag any pattern containing a path separator, not just ones naming a directory
2026-04-23 00:36:23 -06:00
DeflateAwning 8f5a1675f5 test: Add --exact test cases, add --fixed-string cases too 2026-04-22 18:57:28 -06:00
DeflateAwning 82485bf18a feat: Add --exact argument to match exact filename 2026-04-22 18:51:04 -06:00
SAY-5 de422afd0b tests: gate forward-slash+full-path test off Windows
Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>

On Windows the regex-over-full-path match uses `\`, so the
pattern `one/two/c` cannot match a real entry. The diagnostic-
didn't-fire behaviour this test pins is already covered by the
fact that the invocation does not error. Gate it to non-Windows
per tmccombs's CI feedback on the PR.
2026-04-21 00:58:09 -07:00
Thayne McCombs 4f4900b197 test: Fix included files
Fix test_pattern_with_forward_slash_allowed_with_full_path to include
all expected search results.
2026-04-21 01:08:17 -06:00
Thayne McCombs 0e74d5b75d Merge pull request #1979 from YoshKoz/fix/pwsh-placeholder-docs
docs: document PowerShell placeholder quoting requirement
2026-04-20 20:19:56 -06:00
SAY-5 ed47664191 fix: flag any pattern containing a path separator, not just ones that name a directory
Without --full-path, fd matches patterns against file names, so any pattern
containing a path separator can never match. The previous implementation
in main.rs fired the path-separator diagnostic only when the pattern also
named an existing directory on disk, so the most common Linux/macOS typo
- pasting a full path as the pattern - silently returned zero matches.

Restructure ensure_search_pattern_is_not_a_path so that any '/' in the
pattern triggers the diagnostic unconditionally, and keep the existing
'directory must exist on disk' guard only for the native '\' separator
on Windows, which is also the regex escape character. The Windows check
is short-circuited via '||' so the is_dir syscall never runs when the
pattern already contains '/'. The #[cfg_attr(not(windows), allow(unused_mut))]
attribute keeps the mut binding warning-free on non-Windows targets.

Update the error message to drop the now-ambiguous parenthetical that
showed the platform-specific separator character, and widen the
integration test assertions to cover the full first line so the
assert_failure_with_error helper (which trims lines on both sides) cannot
early-accept on a partial prefix.

Closes #1873

Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>
2026-04-20 18:18:21 -07:00
dependabot[bot] 0fc795935d build(deps): bump softprops/action-gh-release from 2.6.1 to 3.0.0
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.6.1 to 3.0.0.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/153bb8e04406b158c6c84fc1615b65b24149a1fe...b4309332981a82ec1c5618f44dd2e27cc8bfbfda)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-20 20:02:35 +00:00
Yoshi Tacke c7f4f19ffb docs: address review feedback
Drop CHANGELOG entry for docs-only change. Simplify placeholder
note to be shell-agnostic per reviewer request.
2026-04-20 20:11:02 +02:00
curious-rabbit 63a7d85d26 improve patch 2026-04-20 14:28:18 +02:00
Yoshi Tacke d45c99b807 docs: document PowerShell placeholder quoting requirement
Closes #735
2026-04-20 10:24:33 +02:00
curious-rabbit 92c54d37c0 fix: sanitize escape sequence injection 2026-04-19 13:11:47 +02:00
dependabot[bot] 9ceba25bd9 build(deps): bump actions/upload-artifact from 7.0.0 to 7.0.1
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/bbbca2ddaa5d8feaa63e36b76fdaad77386f024f...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-17 17:43:00 +00:00
Thayne McCombs 90e73d72df Merge pull request #1959 from tmchow/osc/1958-ignore-parent
feat: add --ignore-parent option to override --no-ignore-parent
2026-04-16 13:03:00 -06:00
Thayne McCombs 749ea313f6 docs: Add PR Expectations
Add expectations for making pull requests to CONTRIBUTING.md

My main objective is to try to discourage low-effort AI generated pull
requests. But I realized several of the guidelines were actually more
general, so made the section as a whole more general.
2026-04-14 00:52:15 -06:00
Trevin Chow 72ff3cf694 feat: add --ignore-parent option to override --no-ignore-parent
Add the --ignore-parent flag, mirroring the existing pattern where
--ignore-vcs overrides --no-ignore-vcs. This lets users undo
--no-ignore-parent in aliases or config files.

Closes #1958
2026-04-06 00:53:39 -07:00
Thayne McCombs a665a3bba9 Merge pull request #1953 from Rohan5commit/docs-macos-comment-20260404
docs: fix macOS spelling in BSD ls comment
2026-04-03 23:44:14 -06:00
Codex 078f5d184e docs: fix macOS spelling in BSD ls comment 2026-04-04 10:14:25 +08:00
Thayne McCombs 607ae385f6 Merge pull request #1950 from sharkdp/dependabot/cargo/tempfile-3.27.0
build(deps): bump tempfile from 3.26.0 to 3.27.0
2026-04-03 00:45:52 -06:00
Thayne McCombs 866ba9bfd5 Merge pull request #1951 from sharkdp/dependabot/cargo/clap_complete-4.6.0
build(deps): bump clap_complete from 4.5.66 to 4.6.0
2026-04-02 01:24:27 -06:00
Thayne McCombs 2f6a2a88c5 Merge pull request #1952 from sharkdp/dependabot/cargo/clap-4.6.0
build(deps): bump clap from 4.5.60 to 4.6.0
2026-04-02 01:23:58 -06:00
dependabot[bot] 5c4654acb6 build(deps): bump clap from 4.5.60 to 4.6.0
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.60 to 4.6.0.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.60...clap_complete-v4.6.0)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-01 22:28:21 +00:00
dependabot[bot] c327231e36 build(deps): bump clap_complete from 4.5.66 to 4.6.0
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.5.66 to 4.6.0.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.66...clap_complete-v4.6.0)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-version: 4.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-01 22:28:16 +00:00
dependabot[bot] 246f5b5e66 build(deps): bump tempfile from 3.26.0 to 3.27.0
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.26.0 to 3.27.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.26.0...v3.27.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-version: 3.27.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-01 22:28:11 +00:00
David Peter 7cf8c85113 Update README 2026-03-31 09:06:11 +02:00
Tavian Barnes fdb5534f66 Merge pull request #1946 from tmccombs/runner-os-update
chore: Update os matrix
2026-03-28 12:30:12 -04:00
Thayne McCombs 1b66ab5d7a chore: Update os matrix
Update the versions of Windows and Mac OSes used in build matrix.

Also add back intel Mac since on the latest version that is still
supported until 2027.

Fixes: #1945
Fixes: #1918
2026-03-28 00:57:39 -06:00
Thayne McCombs 8a7ff7d438 Merge pull request #1941 from tmccombs/fix-attest
Fix attest
2026-03-25 01:08:18 -06:00
Thayne McCombs 45646e2eaf fix(ci): Remove unnecessary compression
Don't compress something that is already compressed.
2026-03-25 00:45:23 -06:00
Thayne McCombs 5008de5052 fix: correct attestation subjects
Use the original files as the source, rather than the file that is
uploaded to the artifact, as that is actually a zip file (what?)

Fixes: #1936
2026-03-25 00:45:23 -06:00
Tavian Barnes d6b44b81b6 Merge pull request #1928 from tmccombs/full-path-fixes
Full path fixes
2026-03-24 06:45:07 -04:00
Thayne McCombs 9d137d358d Merge pull request #1940 from sharkdp/dependabot/github_actions/softprops/action-gh-release-2.6.1
build(deps): bump softprops/action-gh-release from 2.5.0 to 2.6.1
2026-03-23 14:08:37 -07:00
dependabot[bot] 1d386abc84 build(deps): bump softprops/action-gh-release from 2.5.0 to 2.6.1
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.5.0 to 2.6.1.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/a06a81a03ee405af7f2048a818ed3f03bbf83c7b...153bb8e04406b158c6c84fc1615b65b24149a1fe)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.6.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-23 18:04:35 +00:00
Thayne McCombs 0336452b96 Merge pull request #1934 from Rohan5commit/docs/fix-contributing-intro-20260319
Fix CONTRIBUTING introduction grammar
2026-03-18 22:21:52 -07:00
rohan436 f8baea833f docs: fix CONTRIBUTING grammar 2026-03-19 09:41:50 +08:00
Thayne McCombs dc9c503c7d refactor: Rename cwd as full_path_base
Because I think it makes it's intention more clear.
2026-03-17 00:53:34 -06:00
Thayne McCombs cd4fd03fa0 refactor: Avoid unnecessary allocation
Use Cow::borrowed, if we can re-use the already absolute path.
2026-03-17 00:53:34 -06:00
Thayne McCombs fcd846651b Merge pull request #1921 from rexkirshner/fix-exclude-value-name-glob
Change --exclude value name from 'pattern' to 'glob'
2026-03-17 00:17:24 -06:00
Thayne McCombs 6d77799759 Merge pull request #1917 from Xavrir/issue-1900
fix: handle invalid working directories gracefully with --full-path
2026-03-16 02:36:16 -06:00
Thayne McCombs db7d448fd4 Merge pull request #1924 from liruiluo/docs/clarify-exec-arg-boundary
docs: clarify how --exec consumes positional arguments
2026-03-13 20:41:09 -06:00
liruiluo 2278836060 docs: clarify --exec positional argument handling 2026-03-14 09:16:22 +08:00
Rex Kirshner 37f3c2e6cb Change --exclude value name from "pattern" to "glob"
The summary line `-E, --exclude <pattern>` is misleading because fd
defaults to regex for its main search pattern, but --exclude takes a
glob. Rename the value placeholder to "glob" in the CLI help, man page,
and README to match the actual behavior.

Fixes #1724

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 09:03:56 -07:00
Rizky Mirzaviandy Priambodo 807aa11d03 chore: remove unrelated planning files 2026-03-11 22:11:40 +07:00
Rizky Mirzaviandy Priambodo 647ced8ff0 fix: address review comments - use into_os_string() and move changelog to unreleased section 2026-03-11 22:11:26 +07:00
Rizky Mirzaviandy Priambodo 26756f21fa refactor: cache cwd at startup instead of per-entry resolution
Instead of calling current_dir() for every entry when --full-path is
set, cache it once in Config at startup. This eliminates the need for
FatalError handling and makes path resolution infallible during the
walk. If the cwd can't be retrieved, fd now fails early with a clear
error message.
2026-03-10 20:34:38 +07:00
Rizky Mirzaviandy Priambodo 24f7f2b9ef ci: retrigger workflow for second validation pass 2026-03-10 20:28:12 +07:00
Rizky Mirzaviandy Priambodo d3a500af7a fix: handle invalid working directories gracefully with --full-path (#1900)
- Add FatalError variant to WorkerResult for unrecoverable errors
- Extract search_str_for_entry() helper to propagate IO errors from path_absolute_form
- Propagate fatal errors through job and batch execution paths
- Add regression test for invalid cwd scenario
- Update CHANGELOG for #1900
2026-03-10 20:28:12 +07:00
Thayne McCombs 7027d45303 Merge pull request #1916 from tmccombs/release-v10.4.2
chore: Bump to 10.4.2
2026-03-10 01:32:25 -06:00
Thayne McCombs bf6489a79b chore: Bump to 10.4.2 2026-03-09 01:56:38 -06:00
Thayne McCombs 160d00f8fe Add a little more automation for the release
Add an awk script for automatically updating the help
text in README.md
2026-03-09 01:52:08 -06:00
Thayne McCombs cb3fad48bb Merge pull request #1914 from tmccombs/faster-ignore-contains
perf: Avoid unnecessary syscall for ignore-contain
2026-03-08 19:44:38 -06:00
Thayne McCombs a4d86cc1f5 perf: Avoid unnecessary syscall for ignore-contain
Instead of calling `is_dir` on the path, call it on the file_type of the
DirEntry, since we should already have that information without needing
to do another syscall.

Fixes: #1913
2026-03-08 17:09:39 -06:00
Tavian Barnes b691572928 Merge pull request #1912 from tmccombs/changelog-bump
Add upcoming to changelog
2026-03-08 07:58:54 -04:00
Thayne McCombs ec25d2bc81 Add upcoming to changelog 2026-03-08 03:09:13 -06:00
Thayne McCombs 4ea110d8dd Merge pull request #1911 from tmccombs/release-10.4.1
Prepare 10.4.1 release
2026-03-08 01:38:40 -07:00
Thayne McCombs d766e76351 Prepare 10.4.1 release 2026-03-08 01:02:24 -07:00
Thayne McCombs aa35ef4e45 Merge pull request #1904 from tmccombs/fix-deploy
fix(build): Fix attestation
2026-03-07 12:38:21 -07:00
Thayne McCombs b87d919244 fix(build): Remove extra colons 2026-03-07 11:55:38 -07:00
Thayne McCombs bb3d57c433 fix(build): Fix attestation
Use the right output in the github action.

Also pin the versions of the upload-artifact and attest actions.
2026-03-07 01:34:30 -07:00
Thayne McCombs ff1f66cceb Merge pull request #1901 from sharkdp/dependabot/github_actions/actions/attest-build-provenance-4
build(deps): bump actions/attest-build-provenance from 3 to 4
2026-03-06 20:20:54 -07:00
dependabot[bot] d9fc3272db build(deps): bump actions/attest-build-provenance from 3 to 4
Bumps [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) from 3 to 4.
- [Release notes](https://github.com/actions/attest-build-provenance/releases)
- [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md)
- [Commits](https://github.com/actions/attest-build-provenance/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/attest-build-provenance
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-06 17:43:08 +00:00
skane-lukas 247a5172e5 Fix completions for alias fdfind in deb package for bash, zsh and fish.
Closes #1888
2026-03-03 08:38:53 +01:00
Thayne McCombs c60d0076db Merge pull request #1893 from tmccombs/release-10.4.0
chore(release): Prepare for 10.4.0
2026-03-01 11:45:20 -07:00
Thayne McCombs 801ccd7620 chore(release): Prepare for 10.4.0 2026-02-28 23:31:48 -07:00
Thayne McCombs a07ad51751 Merge pull request #1891 from FidelSch/c-static-link
config: statically link C runtime for Windows MSVC
2026-02-24 10:51:08 -07:00
FidelSch 6067f72742 docs: update changelog to include static linking of CRT for MSVC builds 2026-02-24 10:18:59 -03:00
FidelSch 73e6f95416 config: static linking of C runtime on Windows MSVC 2026-02-24 10:13:42 -03:00
Thayne McCombs 40d8eb30bc Merge pull request #1861 from tmccombs/faster-dev-compile
build: Reduce debug info for dev builds
2026-02-02 19:02:50 -07:00
Thayne McCombs 38986aa42c Merge pull request #1881 from sharkdp/dependabot/cargo/jiff-0.2.18
build(deps): bump jiff from 0.2.17 to 0.2.18
2026-02-01 22:23:48 -07:00
dependabot[bot] 171438be2d build(deps): bump jiff from 0.2.17 to 0.2.18
Bumps [jiff](https://github.com/BurntSushi/jiff) from 0.2.17 to 0.2.18.
- [Release notes](https://github.com/BurntSushi/jiff/releases)
- [Changelog](https://github.com/BurntSushi/jiff/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/jiff/compare/jiff-static-0.2.17...jiff-static-0.2.18)

---
updated-dependencies:
- dependency-name: jiff
  dependency-version: 0.2.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-01 23:34:19 +00:00
Thayne McCombs fe0e173e9e Merge pull request #1880 from sharkdp/dependabot/cargo/filetime-0.2.27
build(deps): bump filetime from 0.2.26 to 0.2.27
2026-02-01 16:31:38 -07:00
Thayne McCombs 9a9c4b921d Merge pull request #1882 from sharkdp/dependabot/cargo/nix-0.31.1
build(deps): bump nix from 0.30.1 to 0.31.1
2026-02-01 16:31:11 -07:00
Thayne McCombs efd9f05fcb Merge pull request #1879 from sharkdp/dependabot/cargo/libc-0.2.180
build(deps): bump libc from 0.2.178 to 0.2.180
2026-02-01 16:29:14 -07:00
Thayne McCombs ccafbbb08a Merge pull request #1878 from sharkdp/dependabot/cargo/clap-4.5.54
build(deps): bump clap from 4.5.53 to 4.5.54
2026-02-01 16:27:17 -07:00
dependabot[bot] 74c389f847 build(deps): bump nix from 0.30.1 to 0.31.1
Bumps [nix](https://github.com/nix-rust/nix) from 0.30.1 to 0.31.1.
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.30.1...v0.31.1)

---
updated-dependencies:
- dependency-name: nix
  dependency-version: 0.31.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-01 17:42:47 +00:00
dependabot[bot] 2fc76da442 build(deps): bump filetime from 0.2.26 to 0.2.27
Bumps [filetime](https://github.com/alexcrichton/filetime) from 0.2.26 to 0.2.27.
- [Commits](https://github.com/alexcrichton/filetime/compare/0.2.26...0.2.27)

---
updated-dependencies:
- dependency-name: filetime
  dependency-version: 0.2.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-01 17:42:36 +00:00
dependabot[bot] b22a46c103 build(deps): bump libc from 0.2.178 to 0.2.180
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.178 to 0.2.180.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.180/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.178...0.2.180)

---
updated-dependencies:
- dependency-name: libc
  dependency-version: 0.2.180
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-01 17:42:28 +00:00
dependabot[bot] 1586dabeee build(deps): bump clap from 4.5.53 to 4.5.54
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.53 to 4.5.54.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.53...clap_complete-v4.5.54)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.5.54
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-01 17:42:21 +00:00
Thayne McCombs 0a094a883f Merge pull request #1877 from littleKitchen/docs/update-completions-readme
docs: update shell completions instructions in README
2026-01-30 08:46:50 -07:00
Yuxuan Che 4410dda6e4 docs: add shell completion generation instructions
Add documentation for generating completions using fd --gen-completions,
while keeping and clarifying the existing instructions for pre-built
completions from release archives.

- Clarify that pre-built completions are in release archives (autocomplete dir)
- Add new section for generating completions with fd --gen-completions
- Include examples for bash, zsh, fish, and powershell
2026-01-29 21:33:12 -08:00
Thayne McCombs bf81fb98fa Merge pull request #1852 from fischman/1727-ignore-contain
`--ignore-contain`: ignore directories containing a named entry.
2026-01-20 00:48:43 -07:00
Thayne McCombs 9508153471 Merge pull request #1862 from jylenhof/master
docs(README): add mise alternative method installation
2026-01-20 00:42:34 -07:00
Thayne McCombs 1a37650b2c Merge pull request #1872 from josephadamsdev/fix-1843-windows-hyperlink-slash
Fix Windows hyperlinks for paths with spaces
2026-01-16 09:04:56 -07:00
Joseph Adams dcc5ff84cd Update CHANGELOG.md 2026-01-16 10:44:01 +01:00
Joseph Adams 9c9eeda209 Update CHANGELOG.md 2026-01-16 10:38:42 +01:00
Joseph Adams 4ba10c7837 Add changelog entry for Windows hyperlink fix 2026-01-16 10:37:21 +01:00
Joseph Adams 2efd99bc52 Update hyperlink test for Windows file URLs 2026-01-15 10:12:16 +01:00
Joseph Adams cd8fedc183 Fix Windows hyperlinks for paths with spaces
Fixes #1843

Changed the host() function for Windows to return '/' instead of ''
to generate RFC 3986 compliant file URLs with three slashes.

Before: file://C:/test/hi%20there.txt (broken)
After:  file:///C:/test/hi%20there.txt (works)

This fixes hyperlinks failing on Windows when file paths contain
spaces or other characters that require percent-encoding.
2026-01-14 23:53:43 +01:00
Ami Fischman f3a8bb7ce6 ignore_contain now has higher precedence than root check. 2026-01-14 07:58:30 -08:00
Ami Fischman 1df183e0cd cargo fmt 2026-01-13 16:37:11 -08:00
Ami Fischman 1993c76971 Fixes for tmccombs review comments. 2026-01-13 16:16:11 -08:00
Thayne McCombs 5f95a78121 Merge pull request #1870 from sharkdp/dependabot/cargo/libc-0.2.178
build(deps): bump libc from 0.2.177 to 0.2.178
2026-01-01 12:28:48 -07:00
Thayne McCombs 49ded38b8a Merge pull request #1869 from sharkdp/dependabot/cargo/tempfile-3.24.0
build(deps): bump tempfile from 3.23.0 to 3.24.0
2026-01-01 12:27:39 -07:00
Thayne McCombs 9907632b89 Merge pull request #1868 from sharkdp/dependabot/cargo/jiff-0.2.17
build(deps): bump jiff from 0.2.16 to 0.2.17
2026-01-01 11:07:50 -07:00
dependabot[bot] 8ec9d3115e build(deps): bump libc from 0.2.177 to 0.2.178
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.177 to 0.2.178.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.178/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.177...0.2.178)

---
updated-dependencies:
- dependency-name: libc
  dependency-version: 0.2.178
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-01 17:01:32 +00:00
dependabot[bot] 96502d2611 build(deps): bump tempfile from 3.23.0 to 3.24.0
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.23.0 to 3.24.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.23.0...v3.24.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-version: 3.24.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-01 17:01:24 +00:00
dependabot[bot] 6c5267e240 build(deps): bump jiff from 0.2.16 to 0.2.17
Bumps [jiff](https://github.com/BurntSushi/jiff) from 0.2.16 to 0.2.17.
- [Release notes](https://github.com/BurntSushi/jiff/releases)
- [Changelog](https://github.com/BurntSushi/jiff/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/jiff/compare/jiff-static-0.2.16...jiff-static-0.2.17)

---
updated-dependencies:
- dependency-name: jiff
  dependency-version: 0.2.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-01 17:01:19 +00:00
Thayne McCombs 84789bfe57 Merge pull request #1864 from sergii4/update-clap-complete-4.5.62
build(deps): bump clap_complete from 4.5.61 to 4.5.62
2025-12-25 08:04:24 -07:00
Sergii Getman 19dcbff562 build(deps): bump clap_complete from 4.5.61 to 4.5.62
This update fixes fish shell completion formatting issues where
ValueEnum descriptions were not properly separated with tabs,
causing fish to fail parsing the completions.

The fix was introduced in clap-rs/clap#5874 which changed the
fish completion generator to use proper multi-line format with
quotes instead of the brace format.

Fixes fish shell completions for options like --type and --color
that have enum values with descriptions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-25 14:48:02 +00:00
jylenhof e311e503ba docs(README): add mise alternative method installation
Signed-off-by: jylenhof <jygithub@lenhof.eu.org>
2025-12-15 22:53:01 +01:00
Thayne McCombs bd33bc0eb6 build: Reduce debug info for dev builds
Hopefully this will sped up dev builds. Adds a new debugging profile if
full debug symbols are needed.
2025-12-13 00:04:05 -07:00
Thayne McCombs f5b4171631 Merge pull request #1859 from sharkdp/dependabot/github_actions/softprops/action-gh-release-2.5.0
build(deps): bump softprops/action-gh-release from 2.4.1 to 2.5.0
2025-12-08 10:58:55 -07:00
dependabot[bot] 16e5d9b816 build(deps): bump softprops/action-gh-release from 2.4.1 to 2.5.0
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.4.1 to 2.5.0.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/6da8fa9354ddfdc4aeace5fc48d7f679b5214090...a06a81a03ee405af7f2048a818ed3f03bbf83c7b)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-08 17:06:22 +00:00
Thayne McCombs c90994b36a Merge pull request #1853 from sharkdp/dependabot/cargo/clap_complete-4.5.61
build(deps): bump clap_complete from 4.5.60 to 4.5.61
2025-12-02 10:46:34 -07:00
dependabot[bot] 728b380c67 build(deps): bump clap_complete from 4.5.60 to 4.5.61
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.5.60 to 4.5.61.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.60...clap_complete-v4.5.61)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-version: 4.5.61
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-02 04:06:28 +00:00
Thayne McCombs 2d9c8dab31 Merge pull request #1855 from sharkdp/dependabot/cargo/clap-4.5.53
build(deps): bump clap from 4.5.51 to 4.5.53
2025-12-01 20:43:19 -07:00
Thayne McCombs 161f3ba7cd Merge pull request #1854 from sharkdp/dependabot/cargo/jiff-0.2.16
build(deps): bump jiff from 0.2.15 to 0.2.16
2025-12-01 20:42:35 -07:00
dependabot[bot] e2ae9e88b2 build(deps): bump clap from 4.5.51 to 4.5.53
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.51 to 4.5.53.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.51...clap_complete-v4.5.53)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.5.53
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-01 18:42:58 +00:00
dependabot[bot] a06417d355 build(deps): bump jiff from 0.2.15 to 0.2.16
Bumps [jiff](https://github.com/BurntSushi/jiff) from 0.2.15 to 0.2.16.
- [Release notes](https://github.com/BurntSushi/jiff/releases)
- [Changelog](https://github.com/BurntSushi/jiff/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/jiff/compare/jiff-static-0.2.15...jiff-static-0.2.16)

---
updated-dependencies:
- dependency-name: jiff
  dependency-version: 0.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-01 18:42:52 +00:00
Ami Fischman d05a718be5 --ignore-contain: ignore directories containing a named entry (e.g. [CACHEDIR.TAG](https://bford.info/cachedir/)).
Fixes #1727.
2025-11-28 11:49:37 -08:00
Thayne McCombs e3a6f8b7e7 Merge pull request #1850 from sharkdp/dependabot/github_actions/actions/checkout-6
build(deps): bump actions/checkout from 5 to 6
2025-11-27 10:22:24 -07:00
dependabot[bot] 76046b23b0 build(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-27 17:05:20 +00:00
Thayne McCombs 098bb568e1 Merge pull request #1849 from bigmoonbit/master
chore: fix typo in tests/tests.rs
2025-11-27 00:34:21 -07:00
bigmoonbit 1fb1cafc15 chore: fix typo in tests/tests.rs
Signed-off-by: bigmoonbit <bigmoonbit@outlook.com>
2025-11-27 15:00:09 +08:00
Tavian Barnes 8661ac473c Merge pull request #1839 from andstepan/fix/read-bin-from-environment
tests/testenv/mod.rs: Change how fd binary executable is located
2025-11-18 07:18:18 -05:00
Andreas Stergiopoulos b6af107ac6 tests/testenv/mod.rs: Change how fd binary executable is located
This commit changes the way that the binary executable of fd is located
during integration tests. Previously, the find_fd_exe function would just
navigate in the parent directory and try to find the binary here. This
method is not appropriate as it assumes that the test directory will have
the same layout as the build directory, which also leaks the build time
configuration.

With this patch, the location of the binary executable is read using the
CARGO_BIN_EXE_fd environment variable. The code at first tries to read
the variable at run time, and if it is not available it then uses the env!
macro which returns the value of the variable exposed at compile time.

This way of reading the binary location makes the code more flexible and
friendlier to cross compile.

This commit closes #1838 .

Signed-off-by: Andreas Stergiopoulos <andreas.stergiopoulos@smile.fr>
2025-11-18 10:25:35 +01:00
Thayne McCombs 491baaa2d1 Merge pull request #1834 from tmccombs/cross-install
cross install
2025-11-11 00:09:02 -07:00
Thayne McCombs 68fa2dbaed feat(build): Install cross directly
Removes a dependency on an action repo.

This works similarly to how ripgrep currently installs cross.
2025-11-11 00:02:33 -07:00
Tavian Barnes 15b57b9e78 Merge pull request #1833 from tmccombs/build-fixes
fix[build]: Fix syntax of github action
2025-11-09 18:06:33 -05:00
Thayne McCombs 3b32256715 fix[build]: Fix syntax of github action 2025-11-09 15:51:16 -07:00
Tavian Barnes 32f9fd3314 Merge pull request #1832 from sharkdp/dependabot/cargo/globset-0.4.18
build(deps): bump globset from 0.4.17 to 0.4.18
2025-11-09 09:45:31 -05:00
Tavian Barnes cfc4ace4f4 Merge pull request #1831 from sharkdp/dependabot/cargo/lscolors-0.21.0
build(deps): bump lscolors from 0.20.0 to 0.21.0
2025-11-09 09:45:17 -05:00
Tavian Barnes 7fdfd40107 Merge pull request #1830 from sharkdp/dependabot/cargo/ignore-0.4.25
build(deps): bump ignore from 0.4.24 to 0.4.25
2025-11-09 09:45:03 -05:00
dependabot[bot] d7bfcf48b8 build(deps): bump globset from 0.4.17 to 0.4.18
Bumps [globset](https://github.com/BurntSushi/ripgrep) from 0.4.17 to 0.4.18.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/compare/globset-0.4.17...globset-0.4.18)

---
updated-dependencies:
- dependency-name: globset
  dependency-version: 0.4.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-09 09:16:26 +00:00
dependabot[bot] 942b68ea3b build(deps): bump lscolors from 0.20.0 to 0.21.0
Bumps [lscolors](https://github.com/sharkdp/lscolors) from 0.20.0 to 0.21.0.
- [Release notes](https://github.com/sharkdp/lscolors/releases)
- [Commits](https://github.com/sharkdp/lscolors/compare/v0.20.0...v0.21.0)

---
updated-dependencies:
- dependency-name: lscolors
  dependency-version: 0.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-09 09:16:21 +00:00
dependabot[bot] e08038c34c build(deps): bump ignore from 0.4.24 to 0.4.25
Bumps [ignore](https://github.com/BurntSushi/ripgrep) from 0.4.24 to 0.4.25.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/compare/ignore-0.4.24...ignore-0.4.25)

---
updated-dependencies:
- dependency-name: ignore
  dependency-version: 0.4.25
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-09 09:16:14 +00:00
Thayne McCombs 2f5ab52897 Merge pull request #1828 from HastD/zizmor
ci: resolve Zizmor-identified workflow issues
2025-11-09 02:15:24 -07:00
Thayne McCombs 19e752d184 Merge pull request #1829 from jaideepkathiresan/docs/security-policy
docs(security): clarify where to send vulnerability reports (#1827)
2025-11-09 00:47:21 -07:00
jaideepkathiresan c3652afc2b docs(security): clarify where to send vulnerability reports (#1827) 2025-11-09 09:22:18 +05:30
Daniel Hast 7014993561 ci: resolve Zizmor-identified workflow issues
* Set dependabot cooldown timer of 7 days, which helps mitigate
  stability and supply-chain security risks. For more info, see
  https://docs.zizmor.sh/audits/#dependabot-cooldown
* Restrict write permissions to the job that actually needs them.
* Set `persist-credentials: false` for `actions/checkout`. See
  https://docs.zizmor.sh/audits/#artipacked
* Use environment variables instead of template expansions in code
  contexts. See https://docs.zizmor.sh/audits/#template-injection
* Pin action dependencies to SHA hashes.
2025-11-06 11:48:12 -05:00
Thayne McCombs 72e54e8e9e Merge pull request #1824 from sharkdp/dependabot/cargo/ctrlc-3.5.1
build(deps): bump ctrlc from 3.5.0 to 3.5.1
2025-11-03 23:29:19 -07:00
Thayne McCombs cd95cfcfe0 Merge pull request #1826 from sharkdp/dependabot/cargo/clap_complete-4.5.60
build(deps): bump clap_complete from 4.5.59 to 4.5.60
2025-11-01 13:23:55 -06:00
Thayne McCombs 78a34dd1e9 Merge pull request #1825 from sharkdp/dependabot/cargo/clap-4.5.51
build(deps): bump clap from 4.5.50 to 4.5.51
2025-11-01 13:23:29 -06:00
Thayne McCombs e7e78d7b6a Merge pull request #1823 from sharkdp/dependabot/cargo/aho-corasick-1.1.4
build(deps): bump aho-corasick from 1.1.3 to 1.1.4
2025-11-01 13:22:58 -06:00
dependabot[bot] a19c874fee build(deps): bump clap_complete from 4.5.59 to 4.5.60
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.5.59 to 4.5.60.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.59...clap_complete-v4.5.60)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-version: 4.5.60
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 17:01:20 +00:00
dependabot[bot] 90c94a2ea9 build(deps): bump clap from 4.5.50 to 4.5.51
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.50 to 4.5.51.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.50...clap_complete-v4.5.51)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.5.51
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 17:01:14 +00:00
dependabot[bot] 73a470d076 build(deps): bump ctrlc from 3.5.0 to 3.5.1
Bumps [ctrlc](https://github.com/Detegr/rust-ctrlc) from 3.5.0 to 3.5.1.
- [Release notes](https://github.com/Detegr/rust-ctrlc/releases)
- [Commits](https://github.com/Detegr/rust-ctrlc/compare/3.5.0...3.5.1)

---
updated-dependencies:
- dependency-name: ctrlc
  dependency-version: 3.5.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 17:01:08 +00:00
dependabot[bot] 7c2584b11d build(deps): bump aho-corasick from 1.1.3 to 1.1.4
Bumps [aho-corasick](https://github.com/BurntSushi/aho-corasick) from 1.1.3 to 1.1.4.
- [Commits](https://github.com/BurntSushi/aho-corasick/compare/1.1.3...1.1.4)

---
updated-dependencies:
- dependency-name: aho-corasick
  dependency-version: 1.1.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 17:01:03 +00:00
Thayne McCombs 1d85f3be67 Merge pull request #1821 from tmccombs/changelog-updates
docs(CHANGELOG): list bugs fixed by ignore upgrade
2025-11-01 00:40:35 -06:00
Thayne McCombs a836d865f0 Merge pull request #1820 from tmccombs/etc-upgrade
chore(deps): Update etcetera package
2025-11-01 00:40:14 -06:00
Thayne McCombs f360a772b0 docs(CHANGELOG): list bugs fixed by ignore upgrade 2025-10-31 00:52:05 -06:00
Thayne McCombs 202db498c0 chore(deps): Update etcetera package
Which allows removing a dependency on home
2025-10-31 00:08:52 -06:00
Thayne McCombs d23ac06e40 Merge pull request #1813 from tmccombs/rust-version
Rust version
2025-10-27 23:57:53 -06:00
Thayne McCombs dbd3e3c14c build(msrv): Update msrv to 1.90.0
And upgrade to 2024 edition
2025-10-27 02:05:37 -06:00
Thayne McCombs da731c48d9 build(deps): bump ignore to 0.4.24
This should hopefully fix some bugs around gitignore.

Also run `cargo update` to update the lockfile
2025-10-27 02:02:58 -06:00
Thayne McCombs 5558e407be Merge pull request #1805 from tmccombs/exec-nuls
fix: --print0 now works with --exec
2025-10-25 23:49:24 -06:00
Thayne McCombs f77b693db2 Merge pull request #1810 from Sambhram1/master
"Add cargo-binstall support"
2025-10-17 13:09:58 -06:00
Sambhram 9842656b2b "Add cargo-binstall support" 2025-10-17 16:50:14 +00:00
Thayne McCombs 97b3b0404e Merge pull request #1809 from tmccombs/attestation
feat[release]: Add attestation for release artifacts
2025-10-15 16:27:39 -06:00
Thayne McCombs 54fa0112f5 Merge pull request #1808 from sivaramsk/master
Add -C as a short option to change base-directory
2025-10-14 00:38:48 -06:00
Sivaram Kannan c7a05504f4 Remove the trailing white space in -C short option. 2025-10-14 11:42:46 +05:30
Thayne McCombs 80d0fb2b70 feat[release]: Add attestation for release artifacts 2025-10-13 23:59:51 -06:00
Sivaram Kannan 3263141223 Add -C option to the manpage fd.1. 2025-10-14 08:14:46 +05:30
Sivaram Kannan 98a4233e14 Add base-directory entry along with short option -C in the README.md file. 2025-10-14 08:13:55 +05:30
Sivaram Kannan 4e6f46b191 Add short option -C to the option base-directory. 2025-10-14 08:12:04 +05:30
Thayne McCombs 8c9c6bec75 Merge pull request #1802 from sharkdp/dependabot/cargo/anyhow-1.0.100
build(deps): bump anyhow from 1.0.99 to 1.0.100
2025-10-03 01:21:39 -06:00
Thayne McCombs ee5332d0d3 fix: --print0 now works with --exec
If you use --print0 with --exec, it will now print a \0 between each set
of commands run. That is, between the output for the commands run for
each found item.

Fixes: #1797
2025-10-03 01:15:48 -06:00
Thayne McCombs 2ae1154be4 fix: Clippy warning from anyhow update 2025-10-02 23:08:37 -06:00
dependabot[bot] e89650f169 build(deps): bump anyhow from 1.0.99 to 1.0.100
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.99 to 1.0.100.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.99...1.0.100)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-version: 1.0.100
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-02 00:34:09 +00:00
Thayne McCombs ba2dde80f3 Merge pull request #1801 from sharkdp/dependabot/cargo/clap_complete-4.5.58
build(deps): bump clap_complete from 4.5.57 to 4.5.58
2025-10-01 18:29:52 -06:00
Thayne McCombs 7f3dd94092 Merge pull request #1804 from sharkdp/dependabot/cargo/clap-4.5.48
build(deps): bump clap from 4.5.46 to 4.5.48
2025-10-01 18:29:13 -06:00
Thayne McCombs 10d1ecf2a2 Merge pull request #1803 from sharkdp/dependabot/cargo/tempfile-3.23.0
build(deps): bump tempfile from 3.21.0 to 3.23.0
2025-10-01 18:05:41 -06:00
dependabot[bot] 3f77968f1d build(deps): bump clap from 4.5.46 to 4.5.48
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.46 to 4.5.48.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.46...clap_complete-v4.5.48)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.5.48
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 17:01:42 +00:00
dependabot[bot] 92bdd78e56 build(deps): bump tempfile from 3.21.0 to 3.23.0
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.21.0 to 3.23.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.21.0...v3.23.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-version: 3.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 17:01:37 +00:00
dependabot[bot] 27d90dca17 build(deps): bump clap_complete from 4.5.57 to 4.5.58
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.5.57 to 4.5.58.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.57...clap_complete-v4.5.58)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-version: 4.5.58
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 17:01:27 +00:00
Thayne McCombs 47cedbb44e Merge pull request #1799 from ritoban23/fix-powershell-completion-collision
Fix PowerShell completion filename collision on Windows
2025-09-26 08:39:31 -06:00
ritoban23 a32e6a8d3e Fix PowerShell completion filename collision on Windows 2025-09-26 16:08:10 +05:30
David Peter b3e3977c2b Update Tuple logo 2025-09-23 19:39:33 +02:00
Thayne McCombs 8d254c5337 Merge pull request #1796 from sorairolake/remove-build-rs
build: Remove `build.rs`
2025-09-19 09:29:48 -06:00
Shun Sakai 5c4477c9d3 build: Remove build.rs
The `rust-version` field has been set and the MSRV is validated by
this. So the build script is no longer needed.
2025-09-19 19:31:55 +09:00
Thayne McCombs 4344a26540 Merge pull request #1782 from tmccombs/completion-docs
docs: Add some documentation on how to install completions
2025-09-05 19:22:08 -06:00
David Peter 37b67767a2 Update README 2025-09-04 09:03:17 +02:00
Thayne McCombs 1c316becf3 Merge pull request #1791 from sharkdp/dependabot/cargo/anyhow-1.0.99
build(deps): bump anyhow from 1.0.98 to 1.0.99
2025-09-03 11:46:45 -06:00
dependabot[bot] 1ccb6fd2f2 build(deps): bump anyhow from 1.0.98 to 1.0.99
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.98 to 1.0.99.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.98...1.0.99)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-version: 1.0.99
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-03 17:28:47 +00:00
Thayne McCombs e1cb0f44a3 Merge pull request #1792 from sharkdp/dependabot/cargo/libc-0.2.175
build(deps): bump libc from 0.2.174 to 0.2.175
2025-09-03 11:28:29 -06:00
Thayne McCombs 009d776db5 Merge pull request #1790 from sharkdp/dependabot/cargo/clap_complete-4.5.57
build(deps): bump clap_complete from 4.5.55 to 4.5.57
2025-09-03 11:27:48 -06:00
dependabot[bot] 32558eaf4e build(deps): bump libc from 0.2.174 to 0.2.175
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.174 to 0.2.175.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.175/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.174...0.2.175)

---
updated-dependencies:
- dependency-name: libc
  dependency-version: 0.2.175
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-03 10:20:00 +00:00
dependabot[bot] 5be8cc0167 build(deps): bump clap_complete from 4.5.55 to 4.5.57
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.5.55 to 4.5.57.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.55...clap_complete-v4.5.57)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-version: 4.5.57
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-03 06:34:29 +00:00
Thayne McCombs e6cf1875ed Merge pull request #1785 from sharkdp/dependabot/cargo/clap-4.5.46
build(deps): bump clap from 4.5.42 to 4.5.46
2025-09-02 09:41:11 -06:00
Thayne McCombs 377c442c4e Merge pull request #1786 from sharkdp/dependabot/cargo/regex-syntax-0.8.6
build(deps): bump regex-syntax from 0.8.5 to 0.8.6
2025-09-02 09:40:26 -06:00
Thayne McCombs 13d79ffd41 Merge pull request #1787 from sharkdp/dependabot/cargo/regex-1.11.2
build(deps): bump regex from 1.11.1 to 1.11.2
2025-09-02 09:40:03 -06:00
Thayne McCombs ddf144b596 Merge pull request #1788 from sharkdp/dependabot/cargo/tempfile-3.21.0
build(deps): bump tempfile from 3.20.0 to 3.21.0
2025-09-02 09:39:04 -06:00
dependabot[bot] fb3ffca4c7 build(deps): bump tempfile from 3.20.0 to 3.21.0
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.20.0 to 3.21.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.20.0...v3.21.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-version: 3.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-02 10:38:14 +00:00
dependabot[bot] 725b296ce4 build(deps): bump regex from 1.11.1 to 1.11.2
Bumps [regex](https://github.com/rust-lang/regex) from 1.11.1 to 1.11.2.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.11.1...1.11.2)

---
updated-dependencies:
- dependency-name: regex
  dependency-version: 1.11.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-02 09:41:20 +00:00
dependabot[bot] a13e0b9926 build(deps): bump regex-syntax from 0.8.5 to 0.8.6
Bumps [regex-syntax](https://github.com/rust-lang/regex) from 0.8.5 to 0.8.6.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/regex-syntax-0.8.5...regex-syntax-0.8.6)

---
updated-dependencies:
- dependency-name: regex-syntax
  dependency-version: 0.8.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-02 09:35:34 +00:00
dependabot[bot] 9ed1ce98a9 build(deps): bump clap from 4.5.42 to 4.5.46
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.42 to 4.5.46.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.42...clap_complete-v4.5.46)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.5.46
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-02 08:06:54 +00:00
Thayne McCombs e13dd192f1 docs: Add some documentation on how to install completions
Fixes: #1769
2025-08-26 02:48:20 -06:00
Thayne McCombs 498ea1cc77 Merge pull request #1781 from sharkdp/changelog-update
chore: Add next entry to changelog
2025-08-26 02:29:39 -06:00
Thayne McCombs 0d3261daf7 chore: Add next entry to changelog 2025-08-26 02:29:10 -06:00
Thayne McCombs d38148f0aa Merge pull request #1780 from sharkdp/release-10.3
release: 10.3
2025-08-26 01:32:04 -06:00
Thayne McCombs 04832f1ac4 release: 10.3 2025-08-26 00:58:38 -06:00
Tavian Barnes fd06e69ed2 Merge pull request #1776 from tmccombs/os-update
OS update
2025-08-19 16:17:09 -04:00
Thayne McCombs 456afaef88 build: Update OSes for github actions
- Remove macos-13 because GitHub no longer supports it.
 - Update the version of Ubuntu used.
2025-08-19 01:52:07 -06:00
Tavian Barnes 377f8d6ef7 Merge pull request #1771 from sharkdp/dependabot/github_actions/actions/checkout-5
build(deps): bump actions/checkout from 4 to 5
2025-08-12 08:43:34 -04:00
dependabot[bot] d2d1a8580e build(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 06:25:09 +00:00
Thayne McCombs acb7f72254 Merge pull request #1772 from sharkdp/fix-clippy-lifetime-elision
filesystem: Fix a clippy warning about lifetime elision
2025-08-11 23:22:47 -07:00
Tavian Barnes 677823227c filesystem: Fix a clippy warning about lifetime elision 2025-08-11 21:02:01 -04:00
Thayne McCombs d856e78591 Merge pull request #1764 from sharkdp/dependabot/cargo/clap_complete-4.5.55
build(deps): bump clap_complete from 4.5.54 to 4.5.55
2025-08-01 10:37:08 -07:00
Thayne McCombs 0c71954017 Merge pull request #1762 from sharkdp/dependabot/cargo/clap-4.5.42
build(deps): bump clap from 4.5.40 to 4.5.42
2025-08-01 10:35:27 -07:00
dependabot[bot] f58e562809 build(deps): bump clap_complete from 4.5.54 to 4.5.55
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.5.54 to 4.5.55.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.54...clap_complete-v4.5.55)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-version: 4.5.55
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-01 17:21:59 +00:00
dependabot[bot] 221e5dc894 build(deps): bump clap from 4.5.40 to 4.5.42
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.40 to 4.5.42.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.40...clap_complete-v4.5.42)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.5.42
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-01 17:21:45 +00:00
Thayne McCombs 6dfbbe86fc Merge pull request #1736 from tmccombs/package-updates
chore: Update several packages
2025-07-10 00:08:17 -06:00
Thayne McCombs c8f4a6b546 Merge pull request #1750 from sharkdp/dependabot/cargo/libc-0.2.174
build(deps): bump libc from 0.2.172 to 0.2.174
2025-07-06 09:17:14 -06:00
dependabot[bot] d5894ba4f3 build(deps): bump libc from 0.2.172 to 0.2.174
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.172 to 0.2.174.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.174/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.172...0.2.174)

---
updated-dependencies:
- dependency-name: libc
  dependency-version: 0.2.174
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-06 06:38:00 +00:00
Thayne McCombs be94ec6136 Merge pull request #1755 from tmccombs/master
fix: Remove duplicate nix from lockfile

Fixes #1753
2025-07-06 00:36:15 -06:00
Thayne McCombs 6465ce6d65 chore: Update several packages 2025-07-06 00:21:13 -06:00
Thayne McCombs abb188ef37 fix: Remove duplicate nix from lockfile 2025-07-06 00:01:25 -06:00
Thayne McCombs f91d97e475 Merge pull request #1749 from sharkdp/dependabot/cargo/ctrlc-3.4.7
build(deps): bump ctrlc from 3.4.6 to 3.4.7
2025-07-01 13:25:46 -06:00
Thayne McCombs 377c2c05d8 Merge pull request #1747 from sharkdp/dependabot/cargo/clap_complete-4.5.54
build(deps): bump clap_complete from 4.5.52 to 4.5.54
2025-07-01 13:24:43 -06:00
Thayne McCombs a406b0c5de Merge pull request #1748 from sharkdp/dependabot/cargo/argmax-0.4.0
build(deps): bump argmax from 0.3.1 to 0.4.0
2025-07-01 13:24:02 -06:00
Thayne McCombs edb12d22a2 Merge pull request #1746 from sharkdp/dependabot/cargo/clap-4.5.40
build(deps): bump clap from 4.5.39 to 4.5.40
2025-07-01 13:23:39 -06:00
dependabot[bot] 275b56c168 build(deps): bump ctrlc from 3.4.6 to 3.4.7
Bumps [ctrlc](https://github.com/Detegr/rust-ctrlc) from 3.4.6 to 3.4.7.
- [Release notes](https://github.com/Detegr/rust-ctrlc/releases)
- [Commits](https://github.com/Detegr/rust-ctrlc/compare/3.4.6...3.4.7)

---
updated-dependencies:
- dependency-name: ctrlc
  dependency-version: 3.4.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-01 17:26:02 +00:00
dependabot[bot] b108817d31 build(deps): bump argmax from 0.3.1 to 0.4.0
Bumps [argmax](https://github.com/sharkdp/argmax) from 0.3.1 to 0.4.0.
- [Release notes](https://github.com/sharkdp/argmax/releases)
- [Commits](https://github.com/sharkdp/argmax/compare/v0.3.1...v0.4.0)

---
updated-dependencies:
- dependency-name: argmax
  dependency-version: 0.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-01 17:25:57 +00:00
dependabot[bot] 1cadc21b42 build(deps): bump clap_complete from 4.5.52 to 4.5.54
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.5.52 to 4.5.54.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.52...clap_complete-v4.5.54)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-version: 4.5.54
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-01 17:25:51 +00:00
dependabot[bot] db6aefa5b8 build(deps): bump clap from 4.5.39 to 4.5.40
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.39 to 4.5.40.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.39...clap_complete-v4.5.40)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.5.40
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-01 17:25:46 +00:00
Thayne McCombs b7fe2ce91b Merge pull request #1742 from nealsid/remove-illumos-jemalloc
Changes to support building/testing fd on Illumos
2025-06-23 15:03:33 -06:00
Neal S e76e7ffbd3 Remove test_invalid_cwd on illumos
rmdir on illumos does not support removing the current working
directory, so this test errors out with EINVAL when calling
std::fs::remove_dir.
2025-06-23 08:52:40 -04:00
Neal S 5c66878fb4 Make test be excluded at compile time rather than at run-time. 2025-06-23 08:52:40 -04:00
Neal S 1857ffff0c Use printf in a test rather than echo -n
echo -n is not POSIX compliant, and this came up while running tests
on Illumos.
2025-06-23 08:52:40 -04:00
Neal S 56ca42aed0 Do not use jemalloc on Illumos
Fix for #1741: jemalloc doesn't build on Illumos, so add it to the list of excluded
platforms.
2025-06-20 19:03:53 -04:00
Thayne McCombs ba35c5ea67 Merge pull request #1738 from tkb-github/patch-3
Update README.md to RHEL 10
2025-06-08 15:08:33 -06:00
tkb-github 3d704fb4b9 Update README.md to RHEL 10 2025-06-08 15:07:32 +08:00
Thayne McCombs fd5ec5fed5 Merge pull request #1732 from sharkdp/dependabot/cargo/tempfile-3.20.0
build(deps): bump tempfile from 3.19.1 to 3.20.0
2025-06-01 15:54:50 -06:00
Thayne McCombs b2c7cd1e3e Merge pull request #1733 from sharkdp/dependabot/cargo/clap-4.5.39
build(deps): bump clap from 4.5.37 to 4.5.39
2025-06-01 15:54:26 -06:00
Thayne McCombs 851fa4e5bb Merge pull request #1731 from sharkdp/dependabot/cargo/clap_complete-4.5.52
build(deps): bump clap_complete from 4.5.48 to 4.5.52
2025-06-01 15:54:05 -06:00
dependabot[bot] 9f2cf9205d build(deps): bump clap from 4.5.37 to 4.5.39
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.37 to 4.5.39.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.37...clap_complete-v4.5.39)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.5.39
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-01 21:14:17 +00:00
dependabot[bot] f9eaf7e4b9 build(deps): bump clap_complete from 4.5.48 to 4.5.52
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.5.48 to 4.5.52.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.48...clap_complete-v4.5.52)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-version: 4.5.52
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-01 21:14:12 +00:00
Thayne McCombs 0e73fe9aa5 Merge pull request #1735 from sharkdp/dependabot/cargo/jiff-0.2.14
build(deps): bump jiff from 0.2.10 to 0.2.14
2025-06-01 15:13:16 -06:00
dependabot[bot] 8bd92f0572 build(deps): bump jiff from 0.2.10 to 0.2.14
Bumps [jiff](https://github.com/BurntSushi/jiff) from 0.2.10 to 0.2.14.
- [Release notes](https://github.com/BurntSushi/jiff/releases)
- [Changelog](https://github.com/BurntSushi/jiff/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/jiff/compare/jiff-static-0.2.10...jiff-static-0.2.14)

---
updated-dependencies:
- dependency-name: jiff
  dependency-version: 0.2.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-01 17:10:42 +00:00
dependabot[bot] 16fb0cb9d3 build(deps): bump tempfile from 3.19.1 to 3.20.0
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.19.1 to 3.20.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.19.1...v3.20.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-version: 3.20.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-01 17:10:26 +00:00
Thayne McCombs dbea8a68a8 Merge pull request #1716 from jcotton42/windows-aarch64
Add aarch64 Windows to CI.
2025-05-19 22:17:01 -06:00
Thayne McCombs 8b91260815 Merge pull request #1721 from janderssonse/fix/add-security-policy
docs(security): add initial security policy
2025-05-19 22:16:38 -06:00
Thayne McCombs 9bd1647f86 Merge pull request #1722 from musicinmybrain/tikv
Depend on jemallocator as tikv-jemallocator, and update it to 0.6
2025-05-14 20:09:54 -06:00
Benjamin A. Beasley c4250eca2a Update tikv-jemallocator to 0.6 2025-05-14 17:49:05 -04:00
Benjamin A. Beasley cb150c4fd4 Depend on jemallocator as tikv-jemallocator
Upstream writes: “The project is also published as jemallocator for
historical reasons. The two crates are the same except names. For new
projects, it's recommended to use tikv-xxx versions instead.”
2025-05-14 17:46:08 -04:00
Josef Andersson e389e5d275 docs(security): add initial security policy
Signed-off-by: Josef Andersson <janderssonse@proton.me>
2025-05-11 07:33:45 +02:00
Thayne McCombs efe499ac0d Merge pull request #1717 from tmccombs/doc-better
Doc better
2025-04-30 14:02:22 -06:00
Thayne McCombs 0ada245e37 Fix typo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-04-30 12:03:32 -06:00
Thayne McCombs 402d4e7c12 docs: Clarify option positions in README 2025-04-30 01:26:43 -06:00
Thayne McCombs 26795f6a55 docs: Mention how to end --exec-batch args
Fixes: #1694
2025-04-30 01:24:56 -06:00
Thayne McCombs bc79395bcf docs: Better specify that if path is given, pattern must be as well.
See: #1376
2025-04-30 00:55:05 -06:00
Josh Cotton ad75d79a52 Add aarch64 Windows to CI. 2025-04-29 14:40:17 -07:00
Thayne McCombs 494eef044c Merge pull request #1715 from sharkdp/update-crossbeam
Update to crossbeam-channel 0.5.15
2025-04-29 09:18:16 -06:00
Tavian Barnes 563c5f3074 Update to crossbeam-channel 0.5.15
To grab a double-free fix.

Link: https://github.com/crossbeam-rs/crossbeam/pull/1187
2025-04-29 09:06:02 -04:00
Tavian Barnes 0d680b48e8 Merge pull request #1711 from musicinmybrain/etcetera-0.10
Update etcetera from 0.9 to 0.10
2025-04-29 09:05:44 -04:00
Benjamin A. Beasley ec81815c4c Update etcetera from 0.9 to 0.10
- Pin home to <0.5.11 to avoid MSRV problems
2025-04-29 08:55:31 -04:00
Thayne McCombs abf4e470ed Merge pull request #1712 from sharkdp/next-back
Use next_back() instead of last()
2025-04-24 09:36:48 -06:00
Tavian Barnes 5c0c86c2d5 ci: Use Ubuntu 22.04 runners
Ubuntu 20.04 is now unsupported.

Link: https://github.com/actions/runner-images/issues/11101
2025-04-24 10:03:57 -04:00
Tavian Barnes 3651f86162 Use next_back() instead of last()
Fixes a new Clippy warning.
2025-04-24 10:01:06 -04:00
Thayne McCombs 16b46710ee Merge pull request #1703 from sharkdp/dependabot/cargo/clap_complete-4.5.47
build(deps): bump clap_complete from 4.5.44 to 4.5.47
2025-04-02 08:01:35 -06:00
Tavian Barnes edafedbbc7 Merge pull request #1704 from vp-elitnet/changed_opt_doc_fix
doc: Disambiguate modification time vs timestamp
2025-04-02 07:53:07 -05:00
Vilius Panevėžys 5b29a4c8b3 Disambiguate modification time vs timestamp 2025-04-02 12:37:09 +03:00
Thayne McCombs 5f606ad6e2 Merge pull request #1701 from sharkdp/dependabot/cargo/jiff-0.2.5
build(deps): bump jiff from 0.2.4 to 0.2.5
2025-04-01 23:03:53 -06:00
dependabot[bot] 202615ccf7 build(deps): bump jiff from 0.2.4 to 0.2.5
Bumps [jiff](https://github.com/BurntSushi/jiff) from 0.2.4 to 0.2.5.
- [Release notes](https://github.com/BurntSushi/jiff/releases)
- [Changelog](https://github.com/BurntSushi/jiff/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/jiff/compare/jiff-static-0.2.4...jiff-static-0.2.5)

---
updated-dependencies:
- dependency-name: jiff
  dependency-version: 0.2.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-02 04:34:16 +00:00
Thayne McCombs c644330a52 Merge pull request #1702 from sharkdp/dependabot/cargo/anyhow-1.0.97
build(deps): bump anyhow from 1.0.96 to 1.0.97
2025-04-01 22:33:03 -06:00
Thayne McCombs 34acf31e0f Merge pull request #1700 from sharkdp/dependabot/cargo/clap-4.5.35
build(deps): bump clap from 4.5.31 to 4.5.35
2025-04-01 22:32:12 -06:00
Thayne McCombs 7cfd25cbb6 Merge pull request #1699 from sharkdp/dependabot/cargo/tempfile-3.19.1
build(deps): bump tempfile from 3.16.0 to 3.19.1
2025-04-01 22:31:11 -06:00
dependabot[bot] 39a616d6c4 build(deps): bump clap_complete from 4.5.44 to 4.5.47
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.5.44 to 4.5.47.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.44...clap_complete-v4.5.47)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-version: 4.5.47
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-01 17:38:43 +00:00
dependabot[bot] db6eb2959c build(deps): bump anyhow from 1.0.96 to 1.0.97
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.96 to 1.0.97.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.96...1.0.97)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-version: 1.0.97
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-01 17:38:38 +00:00
dependabot[bot] 5e8ae1d337 build(deps): bump clap from 4.5.31 to 4.5.35
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.31 to 4.5.35.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.5.31...clap_complete-v4.5.35)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.5.35
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-01 17:38:29 +00:00
dependabot[bot] e3ce16a7b4 build(deps): bump tempfile from 3.16.0 to 3.19.1
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.16.0 to 3.19.1.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.16.0...v3.19.1)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-version: 3.19.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-01 17:38:24 +00:00
Tavian Barnes 045fd2d689 Merge pull request #1695 from Bzero/patch-1
Fix broken Arch Linux link
2025-03-24 12:57:00 -05:00
Bzero 029ce455fd Fix broken Arch Linux link 2025-03-24 18:12:56 +01:00
Thayne McCombs e5b3269d1d Merge pull request #1649 from Its-Just-Nans/add-documentation-key
Add documentation key in Cargo.toml
2025-03-24 01:56:26 -06:00
Thayne McCombs 2b0f609a48 Merge pull request #1692 from tmccombs/jiff-more
Some small improvements to time filter code after switch to jiff
2025-03-22 15:01:46 -06:00
Thayne McCombs f370301a5b Use guard to ensure cleanup of test time 2025-03-22 02:03:15 -06:00
Thayne McCombs f36c7d0be2 refactor: Simplify time filter code 2025-03-19 00:39:46 -06:00
Thayne McCombs e0363fc9f8 refactor: Avoid passing in current time just for tests
Instead use a thread local variable that we can use to set the current
time, and use a separate now function in tests than the actual binary.
2025-03-17 02:22:38 -06:00
Thayne McCombs 9859d5117c docs: More description of jiff change in changelog 2025-03-16 18:50:51 -06:00
Thayne McCombs 803d1fd38b Merge pull request #1690 from sorairolake/replace-humantime-with-jiff
chore(deps): Replace `humantime` and `chrono` with `jiff`
2025-03-13 01:30:39 -06:00
Shun Sakai bbac76747b chore(deps): Replace chrono with jiff 2025-03-13 11:44:36 +09:00
Shun Sakai 7d57f61dfb chore: Change to use jiff::Zoned
Supports when the duration contains calendar units.
2025-03-12 23:50:47 +09:00
Shun Sakai c670a0b366 chore(deps): Replace humantime with jiff 2025-03-12 18:15:37 +09:00
Thayne McCombs a4fdad6ff7 Merge pull request #1683 from sharkdp/dependabot/cargo/clap-4.5.31
build(deps): bump clap from 4.5.27 to 4.5.31
2025-03-03 10:09:04 -07:00
Thayne McCombs da7ccc21d0 Merge pull request #1682 from sharkdp/dependabot/cargo/libc-0.2.170
build(deps): bump libc from 0.2.169 to 0.2.170
2025-03-03 00:31:19 -07:00
Thayne McCombs 595c1af4b6 Merge pull request #1684 from sharkdp/dependabot/cargo/globset-0.4.16
build(deps): bump globset from 0.4.15 to 0.4.16
2025-03-02 17:51:34 -07:00
Thayne McCombs 69e3f1a6e6 Merge pull request #1681 from sharkdp/dependabot/cargo/anyhow-1.0.96
build(deps): bump anyhow from 1.0.95 to 1.0.96
2025-03-02 17:49:26 -07:00
dependabot[bot] df550cce26 build(deps): bump clap from 4.5.27 to 4.5.31
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.27 to 4.5.31.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.27...v4.5.31)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-02 09:09:23 +00:00
dependabot[bot] cc7472d4db build(deps): bump libc from 0.2.169 to 0.2.170
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.169 to 0.2.170.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.170/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.169...0.2.170)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-02 09:09:22 +00:00
dependabot[bot] 0c2b432fd8 build(deps): bump globset from 0.4.15 to 0.4.16
Bumps [globset](https://github.com/BurntSushi/ripgrep) from 0.4.15 to 0.4.16.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/compare/ignore-0.4.15...globset-0.4.16)

---
updated-dependencies:
- dependency-name: globset
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-02 09:09:18 +00:00
dependabot[bot] 5803cdb401 build(deps): bump anyhow from 1.0.95 to 1.0.96
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.95 to 1.0.96.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.95...1.0.96)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-02 09:09:16 +00:00
Thayne McCombs fe51550687 Merge pull request #1680 from sharkdp/dependabot/cargo/etcetera-0.9.0
build(deps): bump etcetera from 0.8.0 to 0.9.0
2025-03-02 02:08:20 -07:00
dependabot[bot] 54fca540e8 build(deps): bump etcetera from 0.8.0 to 0.9.0
Bumps [etcetera](https://github.com/lunacookies/etcetera) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/lunacookies/etcetera/releases)
- [Commits](https://github.com/lunacookies/etcetera/compare/v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: etcetera
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-01 17:40:12 +00:00
Thayne McCombs 3a56c32a1c Merge pull request #1671 from tmccombs/update-mac-runner
chore: Use macos-13 instead of 12
2025-02-02 10:52:21 -07:00
Thayne McCombs 34d40443a4 Merge pull request #1668 from sharkdp/dependabot/cargo/clap_complete-4.5.44
build(deps): bump clap_complete from 4.5.38 to 4.5.44
2025-02-02 01:33:06 -07:00
Thayne McCombs 3bbe11169a Merge pull request #1669 from sharkdp/dependabot/cargo/clap-4.5.27
build(deps): bump clap from 4.5.23 to 4.5.27
2025-02-02 01:32:39 -07:00
Thayne McCombs d0e2c3d33b Merge pull request #1670 from sharkdp/dependabot/cargo/tempfile-3.16.0
build(deps): bump tempfile from 3.14.0 to 3.16.0
2025-02-02 01:28:24 -07:00
Thayne McCombs 72a58676c6 chore: Use macos-13 instead of 12
Github actions doesn't suport macos-12 anymore
2025-02-02 01:27:51 -07:00
dependabot[bot] 4e6a47fee5 build(deps): bump tempfile from 3.14.0 to 3.16.0
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.14.0 to 3.16.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.14.0...v3.16.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-01 17:25:03 +00:00
dependabot[bot] 29bc3345f1 build(deps): bump clap from 4.5.23 to 4.5.27
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.23 to 4.5.27.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.23...clap_complete-v4.5.27)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-01 17:24:56 +00:00
dependabot[bot] 9c5b66b6b4 build(deps): bump clap_complete from 4.5.38 to 4.5.44
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.5.38 to 4.5.44.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.38...clap_complete-v4.5.44)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-01 17:24:52 +00:00
Thayne McCombs 564a61588d Merge pull request #1663 from tmccombs/more-troubleshooting
docs: Mention --full-path in troubleshooting
2025-01-28 09:09:39 -07:00
Thayne McCombs 8c177567a7 chore: Fix clippy lints
Use is_some_and instead of map_or(false
2025-01-28 01:55:21 -07:00
Thayne McCombs 2a66fbab28 docs: Mention --full-path in troubleshooting
See: #1662
2025-01-28 01:35:00 -07:00
Tavian Barnes 86d6e2d45f Merge pull request #1657 from sharkdp/dependabot/cargo/clap-4.5.23
build(deps): bump clap from 4.5.21 to 4.5.23
2025-01-01 15:49:25 -05:00
Tavian Barnes 62e5b11d8c Merge pull request #1656 from sharkdp/dependabot/cargo/crossbeam-channel-0.5.14
build(deps): bump crossbeam-channel from 0.5.13 to 0.5.14
2025-01-01 15:46:50 -05:00
Tavian Barnes 4327c36280 Merge pull request #1655 from sharkdp/dependabot/cargo/chrono-0.4.39
build(deps): bump chrono from 0.4.38 to 0.4.39
2025-01-01 15:46:09 -05:00
Tavian Barnes 31f8eda117 Merge pull request #1654 from sharkdp/dependabot/cargo/anyhow-1.0.95
build(deps): bump anyhow from 1.0.93 to 1.0.95
2025-01-01 15:45:48 -05:00
Tavian Barnes 727a976d6b Merge pull request #1653 from sharkdp/dependabot/cargo/libc-0.2.169
build(deps): bump libc from 0.2.167 to 0.2.169
2025-01-01 15:45:33 -05:00
dependabot[bot] 0f69a1af62 build(deps): bump clap from 4.5.21 to 4.5.23
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.21 to 4.5.23.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.21...clap_complete-v4.5.23)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-01 17:34:12 +00:00
dependabot[bot] 5ab7a9b56d build(deps): bump crossbeam-channel from 0.5.13 to 0.5.14
Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.13 to 0.5.14.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.13...crossbeam-channel-0.5.14)

---
updated-dependencies:
- dependency-name: crossbeam-channel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-01 17:34:07 +00:00
dependabot[bot] 1cc4cec3cb build(deps): bump chrono from 0.4.38 to 0.4.39
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.38 to 0.4.39.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.38...v0.4.39)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-01 17:34:02 +00:00
dependabot[bot] 64b326da79 build(deps): bump anyhow from 1.0.93 to 1.0.95
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.93 to 1.0.95.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.93...1.0.95)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-01 17:33:57 +00:00
dependabot[bot] ce39d34483 build(deps): bump libc from 0.2.167 to 0.2.169
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.167 to 0.2.169.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.169/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.167...0.2.169)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-01 17:33:53 +00:00
n4n5 f86a460e48 Update Cargo.toml 2024-12-16 17:45:45 +01:00
n4n5 1785baa372 add documentation 2024-12-16 17:44:41 +01:00
Thayne McCombs 331daf10b8 Merge pull request #1644 from sharkdp/dependabot/cargo/clap_complete-4.5.38
build(deps): bump clap_complete from 4.5.28 to 4.5.38
2024-12-09 11:41:18 -07:00
Thayne McCombs 4d957d3a63 Merge pull request #1642 from sharkdp/dependabot/cargo/tempfile-3.14.0
build(deps): bump tempfile from 3.13.0 to 3.14.0
2024-12-02 09:16:35 -07:00
dependabot[bot] 4104411a1b build(deps): bump clap_complete from 4.5.28 to 4.5.38
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.5.28 to 4.5.38.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.28...clap_complete-v4.5.38)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 15:22:24 +00:00
Thayne McCombs 915483bcd0 Merge pull request #1646 from sharkdp/dependabot/cargo/clap-4.5.21
build(deps): bump clap from 4.5.20 to 4.5.21
2024-12-02 08:20:43 -07:00
Thayne McCombs f272180939 Merge pull request #1645 from sharkdp/dependabot/cargo/anyhow-1.0.93
build(deps): bump anyhow from 1.0.89 to 1.0.93
2024-12-02 08:20:18 -07:00
Thayne McCombs 285ff99ce0 Merge pull request #1643 from sharkdp/dependabot/cargo/libc-0.2.167
build(deps): bump libc from 0.2.161 to 0.2.167
2024-12-02 08:19:52 -07:00
dependabot[bot] ff434bb8a0 build(deps): bump clap from 4.5.20 to 4.5.21
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.20 to 4.5.21.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.20...clap_complete-v4.5.21)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 17:47:13 +00:00
dependabot[bot] 54015f3fbe build(deps): bump anyhow from 1.0.89 to 1.0.93
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.89 to 1.0.93.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.89...1.0.93)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 17:47:08 +00:00
dependabot[bot] e11180b323 build(deps): bump libc from 0.2.161 to 0.2.167
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.161 to 0.2.167.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.167/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.161...0.2.167)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 17:46:56 +00:00
dependabot[bot] 9547622726 build(deps): bump tempfile from 3.13.0 to 3.14.0
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.13.0 to 3.14.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.13.0...v3.14.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 17:46:50 +00:00
Thayne McCombs 7a908a474c Merge pull request #1633 from sharkdp/dependabot/cargo/clap-4.5.20
build(deps): bump clap from 4.5.16 to 4.5.20
2024-11-01 22:49:11 -06:00
Thayne McCombs 71deea6671 Merge pull request #1632 from sharkdp/dependabot/cargo/lscolors-0.20.0
build(deps): bump lscolors from 0.19.0 to 0.20.0
2024-11-01 11:47:25 -06:00
Thayne McCombs bb676df284 Merge pull request #1634 from sharkdp/dependabot/cargo/regex-1.11.1
build(deps): bump regex from 1.10.6 to 1.11.1
2024-11-01 11:47:02 -06:00
Thayne McCombs b517934b42 Merge pull request #1630 from sharkdp/dependabot/cargo/tempfile-3.13.0
build(deps): bump tempfile from 3.12.0 to 3.13.0
2024-11-01 11:46:26 -06:00
dependabot[bot] 06483d1df5 build(deps): bump regex from 1.10.6 to 1.11.1
Bumps [regex](https://github.com/rust-lang/regex) from 1.10.6 to 1.11.1.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.6...1.11.1)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-01 17:23:36 +00:00
dependabot[bot] 8c93b19883 build(deps): bump clap from 4.5.16 to 4.5.20
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.16 to 4.5.20.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.16...clap_complete-v4.5.20)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-01 17:23:31 +00:00
dependabot[bot] 4505da8771 build(deps): bump lscolors from 0.19.0 to 0.20.0
Bumps [lscolors](https://github.com/sharkdp/lscolors) from 0.19.0 to 0.20.0.
- [Release notes](https://github.com/sharkdp/lscolors/releases)
- [Commits](https://github.com/sharkdp/lscolors/compare/v0.19.0...v0.20.0)

---
updated-dependencies:
- dependency-name: lscolors
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-01 17:23:25 +00:00
dependabot[bot] 22b73a0253 build(deps): bump tempfile from 3.12.0 to 3.13.0
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.12.0 to 3.13.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.12.0...v3.13.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-01 17:23:14 +00:00
Thayne McCombs 202e32953c Merge pull request #1627 from hamirmahal/style/simplify-string-formatting-for-readability
style: simplify string formatting for readability
2024-10-06 14:25:02 -06:00
Hamir Mahal 87f230a66e fix: formatting in src/ and tests/ 2024-10-06 09:34:41 -07:00
Hamir Mahal 4bdee80afa style: simplify string formatting for readability 2024-10-06 09:33:58 -07:00
Tavian Barnes 3d0d1865c8 Merge pull request #1617 from cstyles/add-mindepth-alias
Add a hidden `--mindepth` alias for `--min-depth`
2024-10-02 12:30:25 -04:00
Collin Styles 0d99badc1b Add a hidden --mindepth alias for --min-depth 2024-10-02 12:22:01 -04:00
Thayne McCombs 3b7b95d081 Merge pull request #1625 from sharkdp/dependabot/cargo/anyhow-1.0.89
build(deps): bump anyhow from 1.0.86 to 1.0.89
2024-10-01 23:51:08 -06:00
dependabot[bot] bd9882d797 build(deps): bump anyhow from 1.0.86 to 1.0.89
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.86 to 1.0.89.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.86...1.0.89)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-02 04:27:23 +00:00
Thayne McCombs 1fed60d5c1 Merge pull request #1623 from sharkdp/dependabot/cargo/libc-0.2.159
build(deps): bump libc from 0.2.158 to 0.2.159
2024-10-01 22:25:13 -06:00
Thayne McCombs f84c1d67c0 Merge pull request #1624 from sharkdp/dependabot/cargo/ignore-0.4.23
build(deps): bump ignore from 0.4.22 to 0.4.23
2024-10-01 22:24:47 -06:00
Thayne McCombs e50cb817e1 Merge pull request #1621 from sharkdp/dependabot/cargo/clap_complete-4.5.28
build(deps): bump clap_complete from 4.5.24 to 4.5.28
2024-10-01 22:23:58 -06:00
Thayne McCombs 8207b3ebae Merge pull request #1622 from sharkdp/dependabot/cargo/globset-0.4.15
build(deps): bump globset from 0.4.14 to 0.4.15
2024-10-01 22:22:30 -06:00
dependabot[bot] aa81800ffa build(deps): bump ignore from 0.4.22 to 0.4.23
Bumps [ignore](https://github.com/BurntSushi/ripgrep) from 0.4.22 to 0.4.23.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/commits)

---
updated-dependencies:
- dependency-name: ignore
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-01 17:18:00 +00:00
dependabot[bot] 5de01fdd7b build(deps): bump libc from 0.2.158 to 0.2.159
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.158 to 0.2.159.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.159/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.158...0.2.159)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-01 17:17:55 +00:00
dependabot[bot] 85764e28ef build(deps): bump globset from 0.4.14 to 0.4.15
Bumps [globset](https://github.com/BurntSushi/ripgrep) from 0.4.14 to 0.4.15.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/compare/globset-0.4.14...ignore-0.4.15)

---
updated-dependencies:
- dependency-name: globset
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-01 17:17:51 +00:00
dependabot[bot] a4b3bd29aa build(deps): bump clap_complete from 4.5.24 to 4.5.28
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.5.24 to 4.5.28.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.24...clap_complete-v4.5.28)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-01 17:17:44 +00:00
Thayne McCombs 27c6b50919 Fix a new clippy warning 2024-09-23 09:42:58 +02:00
Tavian Barnes 8e0bd33af7 Merge pull request #1610 from sharkdp/dependabot/cargo/filetime-0.2.25
build(deps): bump filetime from 0.2.24 to 0.2.25
2024-09-03 10:23:34 -04:00
Thayne McCombs b674b9b820 Merge pull request #1611 from sharkdp/dependabot/cargo/clap_complete-4.5.24
build(deps): bump clap_complete from 4.5.19 to 4.5.24
2024-09-01 12:11:03 -06:00
dependabot[bot] 96ac5fa0a0 build(deps): bump clap_complete from 4.5.19 to 4.5.24
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.5.19 to 4.5.24.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.19...clap_complete-v4.5.24)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-01 17:23:24 +00:00
dependabot[bot] 9b1017a4d5 build(deps): bump filetime from 0.2.24 to 0.2.25
Bumps [filetime](https://github.com/alexcrichton/filetime) from 0.2.24 to 0.2.25.
- [Commits](https://github.com/alexcrichton/filetime/compare/0.2.24...0.2.25)

---
updated-dependencies:
- dependency-name: filetime
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-01 17:23:19 +00:00
Tavian Barnes b191368713 Merge pull request #1607 from tmccombs/release-10.2
Prepare for 10.2.0 release
2024-08-22 15:27:40 -04:00
Thayne McCombs e3d4f57e75 Bump dependencies
In particular, lscolors
2024-08-19 23:29:02 -06:00
Thayne McCombs 1ce6906808 Prepare for 10.2.0 release 2024-08-18 22:55:28 -06:00
Thayne McCombs 9cf415ccc7 Merge pull request #1593 from sharkdp/deb-improvements
Deb improvements
2024-08-08 21:02:08 -06:00
Thayne McCombs e9fe337921 Merge pull request #1596 from RossSmyth/WinLints
Fix up some lints on Windows
2024-08-07 23:16:56 -06:00
Thayne McCombs 8958a7bd74 Merge pull request #1602 from JCHacking/readme_last_version_regex
docs: documentation link of regular expressions to the latest version
2024-08-05 14:30:05 -06:00
JCHacking c26c45dba3 docs: documentation link of regular expressions to the latest version 2024-08-05 13:32:20 +02:00
Thayne McCombs 7decd53c70 Merge pull request #1601 from sharkdp/dependabot/cargo/clap-4.5.13
build(deps): bump clap from 4.5.8 to 4.5.13
2024-08-01 19:12:08 -06:00
Thayne McCombs d5253c5372 Merge pull request #1600 from sharkdp/dependabot/cargo/clap_complete-4.5.8
build(deps): bump clap_complete from 4.5.7 to 4.5.8
2024-08-01 19:11:30 -06:00
Thayne McCombs 3e7691ee6e Merge pull request #1599 from sharkdp/dependabot/cargo/nu-ansi-term-0.50.1
build(deps): bump nu-ansi-term from 0.50.0 to 0.50.1
2024-08-01 19:10:55 -06:00
Thayne McCombs 385131765d Merge pull request #1598 from sharkdp/dependabot/cargo/version_check-0.9.5
build(deps): bump version_check from 0.9.4 to 0.9.5
2024-08-01 19:06:36 -06:00
dependabot[bot] adbae9cf54 build(deps): bump clap from 4.5.8 to 4.5.13
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.8 to 4.5.13.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.8...v4.5.13)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-01 17:45:49 +00:00
dependabot[bot] b862c11550 build(deps): bump clap_complete from 4.5.7 to 4.5.8
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.5.7 to 4.5.8.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.7...clap_complete-v4.5.8)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-01 17:45:44 +00:00
dependabot[bot] e7b93e6c96 build(deps): bump nu-ansi-term from 0.50.0 to 0.50.1
Bumps [nu-ansi-term](https://github.com/nushell/nu-ansi-term) from 0.50.0 to 0.50.1.
- [Release notes](https://github.com/nushell/nu-ansi-term/releases)
- [Changelog](https://github.com/nushell/nu-ansi-term/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nushell/nu-ansi-term/compare/v0.50.0...v0.50.1)

---
updated-dependencies:
- dependency-name: nu-ansi-term
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-01 17:45:36 +00:00
dependabot[bot] 2ea5d2a90e build(deps): bump version_check from 0.9.4 to 0.9.5
Bumps [version_check](https://github.com/SergioBenitez/version_check) from 0.9.4 to 0.9.5.
- [Commits](https://github.com/SergioBenitez/version_check/compare/v0.9.4...v0.9.5)

---
updated-dependencies:
- dependency-name: version_check
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-01 17:45:31 +00:00
Ross Smyth 80a73fda49 Fix unused config struct field on Windows 2024-07-22 10:02:08 -04:00
Ross Smyth db9d2fa299 Fix unused OnceLock import lint on Windows 2024-07-22 10:02:05 -04:00
Thayne McCombs 830fed4f82 Fix Conflicts syntax 2024-07-22 01:34:03 -06:00
Thayne McCombs e3b7dcbb7e Create fdfind symlinks in deb package
To be consistent with the offical debian pckage
2024-07-22 00:33:10 -06:00
Thayne McCombs 55d2e78cc1 Refactor creating deb package into separate script
Which I think is cleaner than having it inline in the github actions
yaml
2024-07-22 00:33:10 -06:00
Thayne McCombs 9f0fea6e21 Merge pull request #1594 from sharkdp/deb-readme-update
Note executable name in release debs
2024-07-17 12:54:07 -06:00
Thayne McCombs 3480df88ef Note executable name in release debs
Fixes: #1592
2024-07-17 00:04:36 -06:00
Thayne McCombs cfced9787e Merge pull request #1571 from tmccombs/hyperlink
Add hyperlink support to fd
2024-07-16 15:57:30 -06:00
Thayne McCombs 9cefd79ef4 Merge pull request #1583 from sharkdp/dependabot/cargo/clap_complete-4.5.7
build(deps): bump clap_complete from 4.5.2 to 4.5.7
2024-07-01 16:05:25 -06:00
dependabot[bot] d5525e171b build(deps): bump clap_complete from 4.5.2 to 4.5.7
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.5.2 to 4.5.7.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.2...clap_complete-v4.5.7)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 21:44:07 +00:00
Thayne McCombs 724275f3ef Merge pull request #1582 from sharkdp/dependabot/cargo/clap-4.5.8
build(deps): bump clap from 4.5.4 to 4.5.8
2024-07-01 15:43:27 -06:00
Thayne McCombs 79d1435c68 Merge pull request #1581 from sharkdp/dependabot/cargo/lscolors-0.18.0
build(deps): bump lscolors from 0.17.0 to 0.18.0
2024-07-01 15:42:50 -06:00
Thayne McCombs 5147fd6aec Merge pull request #1580 from sharkdp/dependabot/cargo/regex-1.10.5
build(deps): bump regex from 1.10.4 to 1.10.5
2024-07-01 15:38:59 -06:00
dependabot[bot] f55708e31d build(deps): bump regex from 1.10.4 to 1.10.5
Bumps [regex](https://github.com/rust-lang/regex) from 1.10.4 to 1.10.5.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.4...1.10.5)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 21:04:01 +00:00
Thayne McCombs b6b16ce959 Merge pull request #1584 from sharkdp/dependabot/cargo/regex-syntax-0.8.4
build(deps): bump regex-syntax from 0.8.3 to 0.8.4
2024-07-01 15:03:19 -06:00
dependabot[bot] e65104e762 build(deps): bump regex-syntax from 0.8.3 to 0.8.4
Bumps [regex-syntax](https://github.com/rust-lang/regex) from 0.8.3 to 0.8.4.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/regex-syntax-0.8.3...regex-syntax-0.8.4)

---
updated-dependencies:
- dependency-name: regex-syntax
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 17:47:29 +00:00
dependabot[bot] da65108efc build(deps): bump clap from 4.5.4 to 4.5.8
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.4 to 4.5.8.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.4...v4.5.8)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 17:47:16 +00:00
dependabot[bot] c74fefabb6 build(deps): bump lscolors from 0.17.0 to 0.18.0
Bumps [lscolors](https://github.com/sharkdp/lscolors) from 0.17.0 to 0.18.0.
- [Release notes](https://github.com/sharkdp/lscolors/releases)
- [Commits](https://github.com/sharkdp/lscolors/compare/v0.17.0...v0.18.0)

---
updated-dependencies:
- dependency-name: lscolors
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 17:47:08 +00:00
Thayne McCombs 45d6fbb9e2 Fix percent encoding
When the first digit is 0
2024-06-24 00:39:41 -06:00
Bryan Honof 4e9672250b docs: Add flox install 2024-06-23 13:45:22 +02:00
Thayne McCombs f8270a6a44 Merge pull request #1575 from tmccombs/windows-build-updates
Windows build updates
2024-06-14 13:50:14 -06:00
Thayne McCombs 7042dff969 Continue supporting windows 7 with builds
By using an older version of rust to build the artifacts on windows.

Alternatively we could build separate artifacts for windows 7, and
continue using the latest version of rust for later versions of windows
that are more optimized for more recent versions.

Fixes: #1550
2024-06-14 00:06:08 -06:00
Thayne McCombs f477c4f2c9 Update OS versions for github actions 2024-06-14 00:06:03 -06:00
Thayne McCombs b1f7aef00b Change --hyperlink to be an option instead of a flag 2024-06-11 00:38:01 -06:00
Thayne McCombs d8d2c37ec0 Fix test on windows 2024-06-10 00:55:10 -06:00
Thayne McCombs 609f1adf90 Fix unicode encoding of hyperlinks
The problem, is I based the code on the implementation in ripgrep. But
while ripgrep is writing directly to the stream, I am using a Formatter,
which means I have to write characters, not raw bytes.

Thus we need to percent encode all non-ascii bytes (or we could switch
to writing bytes directly, but that would be more complicated, and I
think percent encoding is safer anyway).
2024-06-09 22:57:00 -06:00
Thayne McCombs bd649e2fd7 Add hyperlink support to fd
Fixes: #1295
Fixes: #1563
2024-06-08 23:38:57 -06:00
Thayne McCombs be815c261a Merge pull request #1567 from sharkdp/dependabot/cargo/nix-0.29.0
build(deps): bump nix from 0.28.0 to 0.29.0
2024-06-02 14:29:42 -06:00
Thayne McCombs d8a808c0e3 Merge pull request #1569 from sharkdp/dependabot/cargo/libc-0.2.155
build(deps): bump libc from 0.2.154 to 0.2.155
2024-06-01 23:49:47 -06:00
Thayne McCombs c92290c3d7 Merge pull request #1566 from sharkdp/dependabot/cargo/anyhow-1.0.86
build(deps): bump anyhow from 1.0.82 to 1.0.86
2024-06-01 23:46:33 -06:00
Thayne McCombs 0649c2b379 Merge pull request #1568 from sharkdp/dependabot/cargo/crossbeam-channel-0.5.13
build(deps): bump crossbeam-channel from 0.5.12 to 0.5.13
2024-06-01 23:46:05 -06:00
dependabot[bot] 755970deba build(deps): bump libc from 0.2.154 to 0.2.155
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.154 to 0.2.155.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.154...0.2.155)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-01 17:56:17 +00:00
dependabot[bot] f897b82d76 build(deps): bump crossbeam-channel from 0.5.12 to 0.5.13
Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.12 to 0.5.13.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.12...crossbeam-channel-0.5.13)

---
updated-dependencies:
- dependency-name: crossbeam-channel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-01 17:56:11 +00:00
dependabot[bot] dbbabed606 build(deps): bump nix from 0.28.0 to 0.29.0
Bumps [nix](https://github.com/nix-rust/nix) from 0.28.0 to 0.29.0.
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.28.0...v0.29.0)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-01 17:56:05 +00:00
dependabot[bot] ac178e20af build(deps): bump anyhow from 1.0.82 to 1.0.86
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.82 to 1.0.86.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.82...1.0.86)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-01 17:55:57 +00:00
David Peter 29936f0fba Update sponsors.md 2024-05-16 16:56:22 +02:00
David Peter bfc16a1dee Remove sponsorship message 2024-05-16 16:55:35 +02:00
Thayne McCombs 289a68bac3 Merge pull request #1555 from tmccombs/fmt-readme
Add --format to help in README
2024-05-08 00:40:02 -06:00
Thayne McCombs fcaff0f385 Add --format to help in README 2024-05-08 00:38:45 -06:00
Thayne McCombs 36163f9c3a Merge pull request #1554 from tmccombs/release-10.1.0
Prepare for 10.1.0 release
2024-05-08 00:36:34 -06:00
Thayne McCombs d90ec1758e Prepare for 10.1.0 release 2024-05-08 00:20:43 -06:00
Thayne McCombs ea22cbd712 Merge pull request #1043 from tmccombs/format-option
Implement option for printing custom formats
2024-05-07 23:10:12 -06:00
Thayne McCombs d44badc190 Implement option for printing custom formats 2024-05-07 22:52:49 -06:00
Thayne McCombs 6becb66185 Merge pull request #1445 from tmccombs/cwd-prefix
feat: Add option to always include cwd prefix
2024-05-07 21:27:45 -06:00
Thayne McCombs 1a1f057e5d Merge pull request #1552 from tmccombs/mac-m1-build
Attempt to add aarch64 osx build to CI
2024-05-07 10:41:09 -06:00
Thayne McCombs 10a269bd3f Merge pull request #1553 from tmccombs/changelog-update
Add upcoming to changelog
2024-05-07 00:24:37 -06:00
Thayne McCombs 90d3381814 docs: Make auto option for --strip-cwd-prefix more clear 2024-05-07 00:24:15 -06:00
Thayne McCombs b1f83a0bb0 feat: Add option to always include cwd prefix
Fixes: #1243
Fixes: #1331
2024-05-07 00:24:06 -06:00
Thayne McCombs 3bc70925a9 Add upcoming to changelog 2024-05-07 00:16:56 -06:00
Thayne McCombs f287f08b9f Attempt to add aarch64 osx build to CI
Fixes: #1088
2024-05-07 00:14:52 -06:00
Tavian Barnes 0e4488e9dc Merge pull request #1549 from tavianator/jemalloc-aarch64
Fix #1085 for real
2024-05-06 12:39:49 -04:00
Tavian Barnes d7d63eddbe Fix #1085 for real
cross doesn't pass all environment variables through into the build
container, so JEMALLOC_SYS_WITH_LG_PAGE=16 wasn't being picked up from
the host.  Instead, set it explicitly in Cross.toml.

Link: https://github.com/cross-rs/cross/wiki/Configuration
2024-05-06 12:29:11 -04:00
Thayne McCombs 8acd7722f0 Merge pull request #1548 from tmccombs/release-9.1.0
Release 10.0.0
2024-05-06 00:01:31 -06:00
Thayne McCombs 92fab6e058 Prepare for 10.0.0 release 2024-05-05 23:52:50 -06:00
Thayne McCombs a0ee0856db Add @timestamp to --help 2024-05-05 23:52:50 -06:00
Thayne McCombs b8df500a70 Add script to automate some of release process. 2024-05-05 23:52:50 -06:00
Thayne McCombs cd96ca071d Merge pull request #1547 from tavianator/jemalloc-aarch64
ci: Support large page sizes on AArch64
2024-05-03 21:46:40 -06:00
Tavian Barnes 216472ff9f ci: Support large page sizes on AArch64
Fixes #1085.
2024-05-03 15:23:41 -04:00
Thayne McCombs 3680d10e5c Merge pull request #1544 from sharkdp/dependabot/cargo/libc-0.2.154
build(deps): bump libc from 0.2.153 to 0.2.154
2024-05-01 12:03:31 -06:00
dependabot[bot] abe3b9cd78 build(deps): bump libc from 0.2.153 to 0.2.154
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.153 to 0.2.154.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.153...0.2.154)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-01 17:47:51 +00:00
Thayne McCombs 7aad6c9edf Merge pull request #1543 from sharkdp/dependabot/cargo/chrono-0.4.38
build(deps): bump chrono from 0.4.37 to 0.4.38
2024-05-01 11:47:39 -06:00
Thayne McCombs ddd3aae249 Merge pull request #1542 from sharkdp/dependabot/cargo/nix-0.28.0
build(deps): bump nix from 0.27.1 to 0.28.0
2024-05-01 11:46:53 -06:00
dependabot[bot] 6d3bb68faf build(deps): bump chrono from 0.4.37 to 0.4.38
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.37 to 0.4.38.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.37...v0.4.38)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-01 17:31:34 +00:00
dependabot[bot] 21d50dae8c build(deps): bump nix from 0.27.1 to 0.28.0
Bumps [nix](https://github.com/nix-rust/nix) from 0.27.1 to 0.28.0.
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.27.1...v0.28.0)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-01 17:31:29 +00:00
David Peter 9279b1f0af Fix typo in CHANGELOG 2024-04-30 15:56:12 +02:00
Thayne McCombs 6647085015 Add test for gitignore workaround
And make sure it works for user-supplied path of "."

Also add changelog entry
2024-04-30 15:56:12 +02:00
Thayne McCombs 6af8f092ee Workaround for bug with gitinored files
This is a workaround for
https://github.com/BurntSushi/ripgrep/issues/2711

Fixes: #1461
2024-04-30 15:56:12 +02:00
Thayne McCombs c4094c7a05 Merge pull request #1492 from AlbydST/master
Add installation instructions for more Linux distributions in README
2024-04-29 13:13:38 -06:00
AlbydS 6d58df5f0c Remove unnecessary sudo in front of commands
Removed unnecessary "sudo" in front of all commands, also removed the "replace sudo with doas..." instruction at the end.
2024-04-29 18:04:39 +00:00
AlbydS ffecccf209 Merge branch 'sharkdp:master' into master 2024-04-29 17:58:24 +00:00
Thayne McCombs 31f2839751 Merge pull request #1540 from tmccombs/revert-git-ignore
Stop ignore .git folders by default
2024-04-28 20:33:03 -06:00
Thayne McCombs e10a4eab2b Stop ignore .git folders by default
Fixes: #1457
See: #1396, #1403
2024-04-28 20:23:25 -06:00
Thayne McCombs 8eb047945e Merge pull request #1541 from tavianator/clippy-is-empty
filesystem: Remove a redundant as_str()
2024-04-28 20:22:10 -06:00
Tavian Barnes 1031325cca filesystem: Remove a redundant as_str() 2024-04-28 17:30:44 -04:00
Tavian Barnes 9fc2167cf9 Merge pull request #1505 from leuven65/master
set default path separator to '/' in UCRT64 of MSYS
2024-04-28 17:23:43 -04:00
Tavian Barnes ae1de4de24 Merge pull request #1539 from tmccombs/fix-clippy
Fix deprecation warning.
2024-04-28 17:21:41 -04:00
Thayne McCombs 7e5d14b733 Fix deprecation warning. 2024-04-27 21:58:54 -06:00
Thayne McCombs 85cbea8dcb Merge pull request #1494 from nabellows/master
Add support for @%s time format
2024-04-26 22:37:54 -06:00
Thayne McCombs bc6782624e Merge pull request #1520 from tmccombs/clippy
Add clippy using latest rust version to CI
2024-04-15 00:17:20 -06:00
Thayne McCombs cf6ff87c7d Add clippy using latest rust version to CI
Fixes: #1511
2024-04-14 23:33:40 -06:00
Thayne McCombs 3cd73d7927 Merge pull request #1536 from bin-ly/master
Use 'MAIN_SEPARATOR_STR' instead of '&MAIN_SEPARATOR.to_string()'
2024-04-14 20:58:12 -06:00
binlingyu 7794c4aae5 Use 'MAIN_SEPARATOR_STR' instead of '&MAIN_SEPARATOR.to_string()' 2024-04-15 10:36:10 +08:00
Thayne McCombs 8c7a84ea30 Merge pull request #1534 from tmccombs/msrv-update
Update MSRV to 1.77.2
2024-04-11 23:06:41 -06:00
Thayne McCombs e262ade74e Update MSRV to 1.77.2
Prior to this version, `Command` didn't properly escape command line
arguments on windows.

Although, the risk of attacker controlled arguments passed through fd is
relatively small, I think it is best to upgrade to a version that fixes
this.

The biggest risk for users is probably running fd with `--exec` or
`--exec-batch` on directories that contain files with names controlled
by another party (for example a git repo that you cloned).

See: https://blog.rust-lang.org/2024/04/09/cve-2024-24576.html
Security: CVE-2024-24576
2024-04-11 21:14:11 -06:00
Thayne McCombs 11069e284a Merge pull request #1530 from sharkdp/dependabot/cargo/lscolors-0.17.0
build(deps): bump lscolors from 0.16.0 to 0.17.0
2024-04-01 15:22:35 -06:00
Thayne McCombs 6e2e86decb Merge pull request #1529 from sharkdp/dependabot/cargo/aho-corasick-1.1.3
build(deps): bump aho-corasick from 1.1.2 to 1.1.3
2024-04-01 15:22:15 -06:00
Thayne McCombs 15d3b63ccc Merge pull request #1531 from sharkdp/dependabot/cargo/crossbeam-channel-0.5.12
build(deps): bump crossbeam-channel from 0.5.11 to 0.5.12
2024-04-01 15:21:48 -06:00
dependabot[bot] 453577651e build(deps): bump crossbeam-channel from 0.5.11 to 0.5.12
Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.11 to 0.5.12.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.11...crossbeam-channel-0.5.12)

---
updated-dependencies:
- dependency-name: crossbeam-channel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 17:31:12 +00:00
dependabot[bot] 39c07b7b4c build(deps): bump lscolors from 0.16.0 to 0.17.0
Bumps [lscolors](https://github.com/sharkdp/lscolors) from 0.16.0 to 0.17.0.
- [Release notes](https://github.com/sharkdp/lscolors/releases)
- [Commits](https://github.com/sharkdp/lscolors/compare/0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: lscolors
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 17:31:06 +00:00
dependabot[bot] 5910285db0 build(deps): bump aho-corasick from 1.1.2 to 1.1.3
Bumps [aho-corasick](https://github.com/BurntSushi/aho-corasick) from 1.1.2 to 1.1.3.
- [Commits](https://github.com/BurntSushi/aho-corasick/compare/1.1.2...1.1.3)

---
updated-dependencies:
- dependency-name: aho-corasick
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 17:31:00 +00:00
Thayne McCombs 68fe31da3f Merge pull request #1517 from one230six/master
refactor: Optimize code based on cargo clippy suggestions
2024-03-13 22:27:48 -06:00
Jian Wang f875ea9a52 Set default path separator to '/' in MSYS/MSYS2
The environments of MSYS: [[https://www.msys2.org/docs/environments/]]
2024-03-13 19:32:13 +01:00
one230six 138919907b refactor: Optimize code based on cargo clippy suggestions
Signed-off-by: one230six <723682061@qq.com>
2024-03-13 15:37:24 +08:00
Thayne McCombs b8744626e7 Merge pull request #1515 from sharkdp/dependabot/github_actions/softprops/action-gh-release-2
build(deps): bump softprops/action-gh-release from 1 to 2
2024-03-11 11:55:43 -06:00
dependabot[bot] b08d78f6fc build(deps): bump softprops/action-gh-release from 1 to 2
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-11 17:45:08 +00:00
Tavian Barnes 4efc05ef27 Merge pull request #1510 from garlic-hub/clippy
Clean up clippy warnings
2024-03-08 16:23:38 -05:00
garlic-hub 0788c43c3f Clean up clippy warnings 2024-03-08 10:46:24 -08:00
Thayne McCombs 3b2fd158b5 Merge pull request #1502 from sharkdp/dependabot/cargo/tempfile-3.10.1
build(deps): bump tempfile from 3.9.0 to 3.10.1
2024-03-01 11:16:34 -07:00
Thayne McCombs c38dbacbd0 Merge pull request #1500 from sharkdp/dependabot/cargo/libc-0.2.153
build(deps): bump libc from 0.2.151 to 0.2.153
2024-03-01 11:15:55 -07:00
Thayne McCombs 728b3200c0 Merge pull request #1503 from sharkdp/dependabot/cargo/chrono-0.4.34
build(deps): bump chrono from 0.4.31 to 0.4.34
2024-03-01 11:15:23 -07:00
dependabot[bot] 7f74cd9e56 build(deps): bump chrono from 0.4.31 to 0.4.34
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.31 to 0.4.34.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.31...v0.4.34)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 17:42:05 +00:00
dependabot[bot] 6ae8da6a39 build(deps): bump tempfile from 3.9.0 to 3.10.1
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.9.0 to 3.10.1.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.9.0...v3.10.1)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 17:41:57 +00:00
dependabot[bot] f699c8bb6a build(deps): bump libc from 0.2.151 to 0.2.153
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.151 to 0.2.153.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.151...0.2.153)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 17:41:45 +00:00
Nathan Bellows ffde94c10e Run formatting 2024-02-12 02:12:58 -08:00
Nathan Bellows b0a8848f68 Add support for @%s time format 2024-02-12 02:05:41 -08:00
AlbydS d651a595d4 Add installation instructions for more Linux distributions in README
Added installation instructions for Arch AUR, ALT Linux and Solus and did a few minor changes
2024-02-11 21:25:33 +01:00
David Peter 969316cc0e More whitespace 2024-02-07 09:32:16 +01:00
David Peter 5b46867507 Add Terminal Trove sponsorship 2024-02-07 09:30:20 +01:00
Thayne McCombs e117a373a7 Merge pull request #1488 from sharkdp/dependabot/cargo/nu-ansi-term-0.50.0
build(deps): bump nu-ansi-term from 0.49.0 to 0.50.0
2024-02-01 15:18:00 -07:00
dependabot[bot] a4aed14337 build(deps): bump nu-ansi-term from 0.49.0 to 0.50.0
Bumps [nu-ansi-term](https://github.com/nushell/nu-ansi-term) from 0.49.0 to 0.50.0.
- [Release notes](https://github.com/nushell/nu-ansi-term/releases)
- [Changelog](https://github.com/nushell/nu-ansi-term/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nushell/nu-ansi-term/compare/v0.49.0...v0.50.0)

---
updated-dependencies:
- dependency-name: nu-ansi-term
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-01 20:50:41 +00:00
Thayne McCombs 9cde3c12a2 Merge pull request #1490 from sharkdp/dependabot/cargo/clap_complete-4.4.9
build(deps): bump clap_complete from 4.4.6 to 4.4.9
2024-02-01 13:50:25 -07:00
Thayne McCombs 906e7a933e Merge pull request #1489 from sharkdp/dependabot/cargo/ignore-0.4.22
build(deps): bump ignore from 0.4.21 to 0.4.22
2024-02-01 13:50:04 -07:00
dependabot[bot] 077d28d13a build(deps): bump ignore from 0.4.21 to 0.4.22
Bumps [ignore](https://github.com/BurntSushi/ripgrep) from 0.4.21 to 0.4.22.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/compare/ignore-0.4.21...ignore-0.4.22)

---
updated-dependencies:
- dependency-name: ignore
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-01 18:34:09 +00:00
dependabot[bot] b55bb1e9be build(deps): bump clap_complete from 4.4.6 to 4.4.9
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.4.6 to 4.4.9.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.4.6...clap_complete-v4.4.9)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-01 18:33:20 +00:00
Thayne McCombs 7a6cc92d6d Merge pull request #1486 from sharkdp/dependabot/cargo/regex-1.10.3
build(deps): bump regex from 1.10.2 to 1.10.3
2024-02-01 11:33:08 -07:00
Thayne McCombs b694c6e673 Merge pull request #1487 from sharkdp/dependabot/cargo/crossbeam-channel-0.5.11
build(deps): bump crossbeam-channel from 0.5.10 to 0.5.11
2024-02-01 11:32:41 -07:00
dependabot[bot] 17895538a0 build(deps): bump crossbeam-channel from 0.5.10 to 0.5.11
Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.10 to 0.5.11.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.10...crossbeam-channel-0.5.11)

---
updated-dependencies:
- dependency-name: crossbeam-channel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-01 17:54:58 +00:00
dependabot[bot] 72ff1f9a87 build(deps): bump regex from 1.10.2 to 1.10.3
Bumps [regex](https://github.com/rust-lang/regex) from 1.10.2 to 1.10.3.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.2...1.10.3)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-01 17:54:48 +00:00
Thayne McCombs ef3194a510 Merge pull request #1483 from ognevny/patch-1
Makefile: use `--locked` for build
2024-01-26 00:25:04 -07:00
Maksim Bondarenkov 8773402246 Makefile: use --locked for build
to be ensured that Cargo.lock is up to date. also it's needed for disributions
2024-01-20 17:44:38 +03:00
Rob ff3fc81db4 Add target aarch64-unknown-linux-musl 2024-01-16 20:32:41 +01:00
Tavian Barnes 0dc3342c33 Merge pull request #1472 from tmccombs/clap-update
Update clap version
2024-01-08 10:36:43 -05:00
Thayne McCombs c66fc812ac Update clap version
Fixes: #1407
2024-01-08 02:03:39 -07:00
Thayne McCombs 14ed023875 Merge pull request #1464 from Ato2207/dir_alias
Added alias --type dir
2024-01-07 12:03:24 -07:00
Tavian Barnes 58284b8dbe Merge pull request #1470 from sharkdp/dependabot/cargo/crossbeam-channel-0.5.10
build(deps): bump crossbeam-channel from 0.5.8 to 0.5.10
2024-01-01 23:38:31 -05:00
Tavian Barnes 60889d0b99 Merge pull request #1468 from sharkdp/dependabot/cargo/tempfile-3.9.0
build(deps): bump tempfile from 3.8.1 to 3.9.0
2024-01-01 23:36:01 -05:00
dependabot[bot] 7e19bad0a4 build(deps): bump tempfile from 3.8.1 to 3.9.0
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.8.1 to 3.9.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.8.1...v3.9.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 18:07:49 +00:00
Thayne McCombs 4b1d73d39d Merge pull request #1469 from sharkdp/dependabot/cargo/filetime-0.2.23
build(deps): bump filetime from 0.2.22 to 0.2.23
2024-01-01 11:07:14 -07:00
dependabot[bot] 03e19a1ad2 build(deps): bump crossbeam-channel from 0.5.8 to 0.5.10
Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.8 to 0.5.10.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.8...crossbeam-channel-0.5.10)

---
updated-dependencies:
- dependency-name: crossbeam-channel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 18:04:12 +00:00
Thayne McCombs 8fb9499c20 Merge pull request #1466 from sharkdp/dependabot/cargo/libc-0.2.151
build(deps): bump libc from 0.2.150 to 0.2.151
2024-01-01 11:03:48 -07:00
Thayne McCombs 38fb6a5958 Merge pull request #1467 from sharkdp/dependabot/cargo/clap_complete-4.4.5
build(deps): bump clap_complete from 4.4.4 to 4.4.5
2024-01-01 11:03:17 -07:00
dependabot[bot] 49cd62d65e build(deps): bump filetime from 0.2.22 to 0.2.23
Bumps [filetime](https://github.com/alexcrichton/filetime) from 0.2.22 to 0.2.23.
- [Commits](https://github.com/alexcrichton/filetime/compare/0.2.22...0.2.23)

---
updated-dependencies:
- dependency-name: filetime
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 17:33:54 +00:00
dependabot[bot] 24bb5216bb build(deps): bump clap_complete from 4.4.4 to 4.4.5
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.4.4 to 4.4.5.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.4.4...clap_complete-v4.4.5)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 17:33:45 +00:00
dependabot[bot] 7f8760fd1f build(deps): bump libc from 0.2.150 to 0.2.151
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.150 to 0.2.151.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.150...0.2.151)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 17:33:39 +00:00
Alexandru-Constantin Atomei 3cb6b9d93a Updated CHANGELOG.md, man page and made alias visible in fd -h too 2024-01-01 17:14:32 +02:00
Atomei Alexandru c591106b86 Merge branch 'master' into dir_alias 2023-12-30 22:58:10 +02:00
Alexandru-Constantin Atomei 9f096737db Added explicit documentation about the possibility of using dir 2023-12-30 22:54:57 +02:00
Alexandru-Constantin Atomei 1bda165b25 Added alias --type dir 2023-12-30 22:14:53 +02:00
Thayne McCombs f48372624d Merge pull request #1463 from Roshanjossey/patch-1
Format notes in Readme
2023-12-27 22:25:00 -07:00
Roshan Jossy 5cd15536b6 Format notes in Readme 2023-12-28 00:50:02 +01:00
Sayan Goswami aeb4a5fdad Fixes typo in README
Fixes a tiny typo: ~defautl~ to default.
2023-12-27 14:32:00 -05:00
Thayne McCombs 9529f30129 fix: Respect NO_COLOR with --list-details option
Fixes: #1455
2023-12-23 21:32:33 +01:00
Thayne McCombs 266311ca33 Merge pull request #1454 from tavianator/thats-a-lot-of-issues
CHANGELOG: Fix issue number typo
2023-12-19 13:37:47 -07:00
Tavian Barnes 954a3900b9 CHANGELOG: Fix issue number typo 2023-12-19 14:04:01 -05:00
David Peter 07343b5baf Update troubleshooting section 2023-12-19 11:45:09 +01:00
David Peter a03ed8b300 Update license information 2023-12-19 11:44:20 +01:00
David Peter 13a93e5cbe Add new unreleased section 2023-12-19 11:42:27 +01:00
David Peter d9c4e6239f Fix names for ARM Debian packages 2023-12-19 11:28:59 +01:00
David Peter 61ebd9be6a Update benchmark results 2023-12-19 11:28:59 +01:00
David Peter e3b40208d5 Preprations for fd 9 release 2023-12-19 11:28:59 +01:00
Tavian Barnes 16c2d1e1d0 walk: Flush stdout in batches
The previous behaviour was designed to mimic the output buffering of
typical UNIX tools: line-buffered if stdout is a TTY, and fully-buffered
otherwise.  More precicely, when printing to a terminal, fd would flush
explicitly after printing any buffered results, then flush after every
single result once streaming mode started.  When not printing to a
terminal, fd never explicitly flushed, so writes would only happen as
the BufWriter filled up.

The new behaviour actually unifies the TTY and non-TTY cases: we flush
after printing the buffered results, then once we start streaming, we
flush after each batch, but *only when the channel is empty*.  This
provides a good balance: if the channel is empty, the receiver thread
might as well flush before it goes to sleep waiting for more results.
If the channel is non-empty, we might as well process those results
before deciding to flush.

For TTYs, this should improve performance by consolidating write() calls
without sacrificing interactivity.  For non-TTYs, we'll be flushing more
often, but only when the receiver would otherwise have nothing to do,
thus improving interactivity without sacrificing performance.  This is
particularly handy when fd is piped into another command (such as head
or grep): with the old behaviour, fd could wait for the whole traversal
to finish before printing anything.  With the new behaviour, fd will
print those results soon after they are received.

Fixes #1313.
2023-12-18 22:01:11 +01:00
Tavian Barnes fea1622724 cli: Tweak default thread count logic 2023-12-18 21:55:18 +01:00
David Peter 00b64f3ccb Suggest to use -u instead of -HI 2023-12-08 13:37:03 +01:00
Thayne McCombs 74b850a642 Merge pull request #1436 from sharkdp/dependabot/cargo/clap-4.4.10
build(deps): bump clap from 4.4.7 to 4.4.10
2023-12-01 11:18:35 -07:00
dependabot[bot] 4202f3939e build(deps): bump test-case from 3.2.1 to 3.3.1
Bumps [test-case](https://github.com/frondeus/test-case) from 3.2.1 to 3.3.1.
- [Release notes](https://github.com/frondeus/test-case/releases)
- [Changelog](https://github.com/frondeus/test-case/blob/master/CHANGELOG.md)
- [Commits](https://github.com/frondeus/test-case/compare/v3.2.1...v3.3.1)

---
updated-dependencies:
- dependency-name: test-case
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-01 18:39:13 +01:00
dependabot[bot] e1ecba2ce4 build(deps): bump lscolors from 0.15.0 to 0.16.0
Bumps [lscolors](https://github.com/sharkdp/lscolors) from 0.15.0 to 0.16.0.
- [Release notes](https://github.com/sharkdp/lscolors/releases)
- [Commits](https://github.com/sharkdp/lscolors/compare/v0.15.0...0.16.0)

---
updated-dependencies:
- dependency-name: lscolors
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-01 18:38:29 +01:00
dependabot[bot] 0853e35e1f build(deps): bump libc from 0.2.149 to 0.2.150
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.149 to 0.2.150.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.149...0.2.150)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-01 18:37:58 +01:00
dependabot[bot] 4b4a74c988 build(deps): bump clap from 4.4.7 to 4.4.10
Bumps [clap](https://github.com/clap-rs/clap) from 4.4.7 to 4.4.10.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.4.7...v4.4.10)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-01 17:25:38 +00:00
Tavian Barnes 84f032eba8 Merge pull request #1422 from tavianator/batch
walk: Send WorkerResults in batches
2023-11-29 10:57:19 -05:00
Tavian Barnes b8a5f95cf2 walk: Limit batch sizes in --exec mode 2023-11-28 15:51:33 -05:00
Tavian Barnes 73260c0e35 walk: Send WorkerResults in batches 2023-11-28 15:51:33 -05:00
Tavian Barnes 5903dec289 Merge pull request #1429 from tavianator/ignore-0.4.21
Bump ignore to 0.4.21
2023-11-26 16:28:55 -05:00
Tavian Barnes 571ebb349b Bump ignore to 0.4.21
This includes all the patches from #1420, so switch back to the official
release.
2023-11-26 14:39:25 -05:00
Tavian Barnes d62bbbbcd1 Merge pull request #1421 from acuteenvy/fix-no-color
fix: display color when `NO_COLOR` is an empty string
2023-11-07 13:29:50 -05:00
Lena ad5fb44ddc fix: display color when NO_COLOR is an empty string 2023-11-04 15:07:10 +01:00
Tavian Barnes 8bbbd7679b walk: New WorkerState struct shared by the worker threads 2023-11-02 17:07:38 +01:00
David Peter cd32a3827d Update lockfile 2023-11-02 08:07:39 +01:00
Tavian Barnes 66c0637c90 Use a patched version of ignore for perf improvements
- https://github.com/BurntSushi/ripgrep/commit/d938e955af7a39ac0245b1ce84924f7f4a2141ac
- https://github.com/BurntSushi/ripgrep/pull/2624
- https://github.com/BurntSushi/ripgrep/pull/2642
2023-11-01 21:20:54 +01:00
Tavian Barnes c9df4296f9 Merge pull request #1419 from sharkdp/dependabot/cargo/clap_complete-4.4.4
build(deps): bump clap_complete from 4.4.3 to 4.4.4
2023-11-01 14:07:43 -04:00
Tavian Barnes 7c5cf28ace Merge pull request #1418 from sharkdp/dependabot/cargo/clap-4.4.7
build(deps): bump clap from 4.4.6 to 4.4.7
2023-11-01 14:07:26 -04:00
Tavian Barnes 51002c842d Merge pull request #1417 from sharkdp/dependabot/cargo/nix-0.27.1
build(deps): bump nix from 0.26.4 to 0.27.1
2023-11-01 13:40:57 -04:00
Tavian Barnes 8e582971fa Merge pull request #1416 from sharkdp/dependabot/cargo/regex-syntax-0.8.2
build(deps): bump regex-syntax from 0.7.5 to 0.8.2
2023-11-01 13:36:58 -04:00
Tavian Barnes 6daa72f929 Merge pull request #1415 from sharkdp/dependabot/cargo/tempfile-3.8.1
build(deps): bump tempfile from 3.8.0 to 3.8.1
2023-11-01 13:36:14 -04:00
dependabot[bot] 8355d78359 build(deps): bump clap_complete from 4.4.3 to 4.4.4
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.4.3 to 4.4.4.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.4.3...clap_complete-v4.4.4)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 17:20:14 +00:00
dependabot[bot] dbc1818073 build(deps): bump clap from 4.4.6 to 4.4.7
Bumps [clap](https://github.com/clap-rs/clap) from 4.4.6 to 4.4.7.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.4.6...v4.4.7)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 17:20:06 +00:00
dependabot[bot] e57ce7f2a4 build(deps): bump nix from 0.26.4 to 0.27.1
Bumps [nix](https://github.com/nix-rust/nix) from 0.26.4 to 0.27.1.
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.26.4...v0.27.1)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 17:19:59 +00:00
dependabot[bot] d8f89fa59e build(deps): bump regex-syntax from 0.7.5 to 0.8.2
Bumps [regex-syntax](https://github.com/rust-lang/regex) from 0.7.5 to 0.8.2.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/regex-syntax-0.7.5...regex-syntax-0.8.2)

---
updated-dependencies:
- dependency-name: regex-syntax
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 17:19:54 +00:00
dependabot[bot] 350003d8da build(deps): bump tempfile from 3.8.0 to 3.8.1
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.8.0 to 3.8.1.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/commits)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 17:19:49 +00:00
tkb-github 15329f9cfa Update RHEL package info 2023-11-01 16:25:25 +01:00
Thayne McCombs 95b4dff379 Merge pull request #1412 from tmccombs/limit-default-threads
Limit default threads
2023-10-27 23:26:31 -06:00
Thayne McCombs c96b1af3be Merge pull request #1410 from tmccombs/available-parallelism
Replace num_cpus with `std::thread::available_parallelism`
2023-10-27 23:25:51 -06:00
Thayne McCombs 5ee6365510 Set maximum default threads
Set a limit of how many threads fd will use by default. On hosts that
have a large number of cores, using additional threads has diminishing
returns, and having large numbers of threads increases the setup cost.
Thus we don't necessarily want to use the same number of threads as we
have cores.

Fixes: #1203
2023-10-26 00:48:30 -06:00
Thayne McCombs 1d57b3a064 Simplify parsing number of threads. 2023-10-25 23:56:59 -06:00
Thayne McCombs 325d419e39 Replace num_cpus with std::thread::available_parallelism
I think this might help startup time a little bit, since it looks like
on linux at least the std implementation uses syscalls to determine the
parallelism, whereas num_cpus was processing the /proc/cpuinfo file.

It also removes another dependency.
2023-10-25 02:00:31 -06:00
Thayne McCombs 8b5532d8dd Merge pull request #1409 from marcospb19/fix-docs-typo
Fix docs typos
2023-10-23 22:10:05 -06:00
João Marcos P. Bezerra 7263b5e01d Fix docs typos 2023-10-24 00:40:12 -03:00
Thayne McCombs c6fcdbe000 docs: Explicitly warn against relying on result order for exec
Supersedes: #1230
Fixes: #1228
2023-10-23 08:34:15 +02:00
Thayne McCombs 306dacd0b4 tests: Add more tests cases for ignoring .git 2023-10-23 08:34:03 +02:00
Thayne McCombs 08910e4e3f docs: Some tweaks from review 2023-10-23 08:34:03 +02:00
Thayne McCombs 8897659607 tests: Add tests for ignoring .git/ 2023-10-23 08:34:03 +02:00
Thayne McCombs 53fd416c47 docs: Document exclusion of .git/ 2023-10-23 08:34:03 +02:00
Thayne McCombs 5e0018fb1f Merge pull request #1402 from tmccombs/nix-users
maint: Remove use of unmaintained users crate
2023-10-22 01:35:47 -06:00
Thayne McCombs 054bae01ef maint: Remove use of unmaintained users crate
The users crate is no longer maintained. There is a maintained fork
called uzers, but we already have a dependency on nix, and that has the
functionality we need.
2023-10-21 23:37:32 -06:00
David Peter 8f32a758a4 Update lock file 2023-10-21 22:16:15 +02:00
David Peter 0fc8facfb7 Fix --help text 2023-10-21 22:16:15 +02:00
Thayne McCombs 069b181625 Fix documentation for brace escapes 2023-10-21 22:16:15 +02:00
Thayne McCombs d9b69c8405 feat: Add a way to escape { and }in exec templates.
fixes #1303
2023-10-21 22:16:15 +02:00
Thayne McCombs a11f8426d4 Fix deprecation warning from chrono
Also change logic to use the latest time if the local time is ambiguous
(for example due to daylight savings)
2023-10-21 14:07:50 +02:00
Thayne McCombs e6aa8e82f6 Add Upcoming Release to changelog 2023-10-21 14:06:52 +02:00
sitiom 978866d983 Change Winget Releaser job to ubuntu-latest 2023-10-21 14:06:25 +02:00
Christian Göttsche 36bc84041b Support character and block device file types 2023-10-21 13:56:33 +02:00
Thayne McCombs 3ed4ea7538 Merge pull request #1396 from skoriop/default-ignore-git-folder
feat: ignore `.git/` by default
2023-10-20 22:35:22 -06:00
Thayne McCombs 6b5fe1c634 Merge pull request #1399 from tmccombs/8.7.1-release
8.7.1 release
2023-10-20 21:57:38 -06:00
Thayne McCombs 7c39fff969 Prepare for 8.7.1 release 2023-10-18 21:44:34 -06:00
Thayne McCombs b922ca18f0 A couple more updates to the changelog 2023-10-18 21:31:28 -06:00
Thayne McCombs b8e7cbd5e3 Merge pull request #1398 from tmccombs/clap-update
Clap update
2023-10-18 09:09:45 -06:00
Karthik Prakash 9df9a489f0 refactor: replace map_err with expect
Co-authored-by: Thayne McCombs <astrothayne@gmail.com>
2023-10-18 13:06:51 +05:30
Thayne McCombs fa01a280ed Update Changelog
This was missed
2023-10-17 23:12:30 -06:00
Thayne McCombs e6b5a4ef9d bug: Update clap to 4.4.6
This also fixes a couple of problems that are now errors:

- Remove use of unstable-grouped feature flag that no longer exists
- Fix some conflicts rules with non-existant options
  * has_results should have been quiet
  * count doesn't exist. I'm not sure where it came from

Fixes: #1397
2023-10-17 23:12:03 -06:00
Thayne McCombs 19832fcbd3 Merge pull request #1386 from SonkeWohler/fix-readme-as-tree
fix(README.md): as-tree is unmaintained, fixes #1040
2023-10-16 10:17:24 -06:00
sonke d371b10039 fix(README.md): as-tree is unmaintained, fixes #1040 2023-10-16 17:54:15 +03:00
skoriop 8c50bc733d docs: update CHANGELOG.md 2023-10-15 11:25:30 +05:30
skoriop 3f9794cd1a feat: ignore .git/ by default 2023-10-15 11:11:53 +05:30
Thayne McCombs fc240f7b2a Merge pull request #1394 from final-israel/make_max_results_one_conflict_with_exec
Making `-1` conflict with `--exec` and making `max-results` override `-1`
2023-10-05 10:27:43 -06:00
Eden Mikitas dea9110b90 Making -1 conflict with --exec and making max-results override -1 2023-10-05 15:10:37 +03:00
Thayne McCombs 93cdb2628e Merge pull request #1391 from sharkdp/dependabot/cargo/jemallocator-0.5.4
Bump jemallocator from 0.5.0 to 0.5.4
2023-10-01 21:28:57 -06:00
Thayne McCombs 817c0bc512 Merge pull request #1390 from sharkdp/dependabot/cargo/libc-0.2.148
Bump libc from 0.2.147 to 0.2.148
2023-10-01 21:28:12 -06:00
Thayne McCombs e97dec777c Merge pull request #1389 from sharkdp/dependabot/cargo/globset-0.4.13
Bump globset from 0.4.10 to 0.4.13
2023-10-01 21:27:32 -06:00
Thayne McCombs 5f494b0925 Merge pull request #1388 from sharkdp/dependabot/cargo/regex-1.9.6
Bump regex from 1.9.1 to 1.9.6
2023-10-01 21:27:02 -06:00
Thayne McCombs 59feb7d6ab Merge pull request #1392 from sharkdp/dependabot/cargo/anyhow-1.0.75
Bump anyhow from 1.0.72 to 1.0.75
2023-10-01 21:26:25 -06:00
dependabot[bot] 97f5326393 Bump anyhow from 1.0.72 to 1.0.75
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.72 to 1.0.75.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.72...1.0.75)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 17:23:46 +00:00
dependabot[bot] e2a298a84f Bump jemallocator from 0.5.0 to 0.5.4
Bumps [jemallocator](https://github.com/tikv/jemallocator) from 0.5.0 to 0.5.4.
- [Release notes](https://github.com/tikv/jemallocator/releases)
- [Changelog](https://github.com/tikv/jemallocator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tikv/jemallocator/compare/0.5.0...0.5.4)

---
updated-dependencies:
- dependency-name: jemallocator
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 17:23:38 +00:00
dependabot[bot] 3317362e78 Bump libc from 0.2.147 to 0.2.148
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.147 to 0.2.148.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.147...0.2.148)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 17:23:31 +00:00
dependabot[bot] 39d0a3ff3c Bump globset from 0.4.10 to 0.4.13
Bumps [globset](https://github.com/BurntSushi/ripgrep) from 0.4.10 to 0.4.13.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/compare/globset-0.4.10...globset-0.4.13)

---
updated-dependencies:
- dependency-name: globset
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 17:23:23 +00:00
dependabot[bot] d36c59920d Bump regex from 1.9.1 to 1.9.6
Bumps [regex](https://github.com/rust-lang/regex) from 1.9.1 to 1.9.6.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.9.1...1.9.6)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 17:23:14 +00:00
Tavian Barnes 995d2f5e44 Merge pull request #1381 from joshuataylor/bump-proc_macro
Bump proc_macro2 to support building on nightly rust
2023-09-18 20:47:15 -05:00
Tavian Barnes 3884f054f1 Merge pull request #1382 from cstyles/bump-clap_complete
Bump clap_complete to 4.4.1
2023-09-09 18:29:25 -04:00
Collin Styles 32504fa3d5 Bump clap_complete to 4.4.1
This fixes an issue with fish shell completions that was causing
problems for fd.
2023-09-09 12:46:43 -07:00
Josh Taylor afd0efa291 Bump proc_macro2 to support building on nightly rust
cargo update proc-macro2

Otherwise the error "error[E0635]: unknown feature
`proc_macro_span_shrink`" will display and the build will fail.

Seems to be okay as of nightly 62ebe3a2b 2023-09-08
2023-09-09 21:15:39 +08:00
Thayne McCombs 737b5bc42e Merge pull request #1377 from sharkdp/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-09-04 13:10:44 -06:00
dependabot[bot] 601d2bb13e Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 17:59:00 +00:00
Thayne McCombs 917c56b120 Merge pull request #1374 from sharkdp/dependabot/cargo/libc-0.2.147
Bump libc from 0.2.144 to 0.2.147
2023-09-02 00:24:27 -06:00
Thayne McCombs 9ffd57f4ef Merge pull request #1373 from sharkdp/dependabot/cargo/chrono-0.4.28
Bump chrono from 0.4.26 to 0.4.28
2023-09-01 12:29:15 -06:00
dependabot[bot] 08a8723ee7 Bump libc from 0.2.144 to 0.2.147
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.144 to 0.2.147.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.144...0.2.147)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-01 18:28:11 +00:00
Thayne McCombs efdba804ac Merge pull request #1372 from sharkdp/dependabot/cargo/clap_complete-4.4.0
Bump clap_complete from 4.3.1 to 4.4.0
2023-09-01 12:27:55 -06:00
Thayne McCombs 6f0632273b Merge pull request #1371 from sharkdp/dependabot/cargo/filetime-0.2.22
Bump filetime from 0.2.20 to 0.2.22
2023-09-01 12:26:57 -06:00
Thayne McCombs c848af33d5 Merge pull request #1375 from sharkdp/dependabot/cargo/regex-syntax-0.7.5
Bump regex-syntax from 0.7.4 to 0.7.5
2023-09-01 12:26:31 -06:00
dependabot[bot] f33de6544f Bump regex-syntax from 0.7.4 to 0.7.5
Bumps [regex-syntax](https://github.com/rust-lang/regex) from 0.7.4 to 0.7.5.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/commits)

---
updated-dependencies:
- dependency-name: regex-syntax
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-01 17:05:34 +00:00
dependabot[bot] d7e5dcf9d2 Bump chrono from 0.4.26 to 0.4.28
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.26 to 0.4.28.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.26...v0.4.28)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-01 17:05:17 +00:00
dependabot[bot] b38ba68ccc Bump clap_complete from 4.3.1 to 4.4.0
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.3.1 to 4.4.0.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.3.1...clap_complete-v4.4.0)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-01 17:05:08 +00:00
dependabot[bot] e55907dc8b Bump filetime from 0.2.20 to 0.2.22
Bumps [filetime](https://github.com/alexcrichton/filetime) from 0.2.20 to 0.2.22.
- [Commits](https://github.com/alexcrichton/filetime/compare/0.2.20...0.2.22)

---
updated-dependencies:
- dependency-name: filetime
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-01 17:04:58 +00:00
Thayne McCombs a248607bee Merge pull request #1350 from tmccombs/regex-upgrade
Regex upgrade
2023-08-09 01:16:00 -06:00
dependabot[bot] ed23fb9054 Upgrade regex and regex-syntax
Bump regex from 1.7.3 to 1.9.1

Bumps [regex](https://github.com/rust-lang/regex) from 1.7.3 to 1.8.3.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com

Bump regex-syntax from 0.6.29 to 0.7.2

Bumps [regex-syntax](https://github.com/rust-lang/regex) from 0.6.29 to 0.7.2.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/commits)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: regex-syntax
  dependency-type: direct:production
  update-type: version-update:semver-minor

Supersedes: #1334
Supersedes: #1343
Signed-off-by: dependabot[bot] <support@github.com>
2023-08-09 01:02:55 -06:00
Thayne McCombs 7d357a6cec Merge pull request #1359 from sharkdp/dependabot/cargo/nu-ansi-term-0.49.0
Bump nu-ansi-term from 0.47.0 to 0.49.0
2023-08-09 00:20:45 -06:00
dependabot[bot] 1feed8816a Bump nu-ansi-term from 0.47.0 to 0.49.0
Bumps [nu-ansi-term](https://github.com/nushell/nu-ansi-term) from 0.47.0 to 0.49.0.
- [Release notes](https://github.com/nushell/nu-ansi-term/releases)
- [Changelog](https://github.com/nushell/nu-ansi-term/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nushell/nu-ansi-term/compare/v0.47.0...v0.49.0)

---
updated-dependencies:
- dependency-name: nu-ansi-term
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-02 01:49:31 +00:00
Tavian Barnes 9ce43b2d7b Merge pull request #1357 from sharkdp/dependabot/cargo/lscolors-0.15.0
Bump lscolors from 0.14.0 to 0.15.0
2023-08-01 20:48:37 -05:00
dependabot[bot] a6a78e1c65 Bump lscolors from 0.14.0 to 0.15.0
Bumps [lscolors](https://github.com/sharkdp/lscolors) from 0.14.0 to 0.15.0.
- [Release notes](https://github.com/sharkdp/lscolors/releases)
- [Commits](https://github.com/sharkdp/lscolors/compare/v0.14.0...v0.15.0)

---
updated-dependencies:
- dependency-name: lscolors
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-02 01:10:43 +00:00
Thayne McCombs cd14bb8a2c Merge pull request #1358 from sharkdp/dependabot/cargo/chrono-0.4.26
Bump chrono from 0.4.24 to 0.4.26
2023-08-01 18:09:49 -07:00
Thayne McCombs 7162f28a5b Merge pull request #1360 from sharkdp/dependabot/cargo/anyhow-1.0.72
Bump anyhow from 1.0.71 to 1.0.72
2023-08-01 18:07:10 -07:00
dependabot[bot] 2328e9cd17 Bump anyhow from 1.0.71 to 1.0.72
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.71 to 1.0.72.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.71...1.0.72)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-01 17:20:32 +00:00
dependabot[bot] 2a6026b25d Bump chrono from 0.4.24 to 0.4.26
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.24 to 0.4.26.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.24...v0.4.26)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-01 17:20:18 +00:00
tkb-github c62224d2c3 Update instructions for RHEL8 etc. 2023-07-23 13:12:26 +02:00
Thayne McCombs 9a40d21ceb Merge pull request #1351 from frisoft/master
Update license field following SPDX 2.1 license expression standard
2023-07-20 10:40:48 -06:00
Andrea Frigido d019b02829 Update license field following SPDX 2.1 license expression standard 2023-07-20 08:29:10 +01:00
Thayne McCombs 2f813601aa Merge pull request #1340 from sharkdp/dependabot/cargo/clap_complete-4.3.1
Bump clap_complete from 4.3.0 to 4.3.1
2023-07-01 16:27:30 -06:00
Thayne McCombs aae8519a1d Merge pull request #1341 from sharkdp/dependabot/cargo/tempfile-3.6.0
Bump tempfile from 3.5.0 to 3.6.0
2023-07-01 16:23:56 -06:00
Thayne McCombs 4bfb903b22 Merge pull request #1342 from sharkdp/dependabot/cargo/num_cpus-1.16.0
Bump num_cpus from 1.15.0 to 1.16.0
2023-07-01 14:02:54 -06:00
dependabot[bot] d91b2a202e Bump num_cpus from 1.15.0 to 1.16.0
Bumps [num_cpus](https://github.com/seanmonstar/num_cpus) from 1.15.0 to 1.16.0.
- [Release notes](https://github.com/seanmonstar/num_cpus/releases)
- [Changelog](https://github.com/seanmonstar/num_cpus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/num_cpus/compare/v1.15.0...v1.16.0)

---
updated-dependencies:
- dependency-name: num_cpus
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-01 17:25:18 +00:00
dependabot[bot] a74a43987a Bump tempfile from 3.5.0 to 3.6.0
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.5.0 to 3.6.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.5.0...v3.6.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-01 17:25:13 +00:00
dependabot[bot] 2a588a0171 Bump clap_complete from 4.3.0 to 4.3.1
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.3.0...clap_complete-v4.3.1)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-01 17:25:09 +00:00
Utkarsh Gupta 3ae04546ea Replace dirs-next crate with etcetera crate 2023-06-14 21:22:28 +02:00
Thayne McCombs a0370aaf25 Merge pull request #1333 from tmccombs/rust-170
Rust 1.70 upgrade
2023-06-12 00:32:06 -06:00
Thayne McCombs 740edeb73f Replace atty with std
std now has a function for testing if stdout is a tty
2023-06-08 00:10:53 -06:00
Thayne McCombs 91e3c3cba5 Replace once_cell with stdlib
LazyLock isn't standardized yet, but OnceLock is good enough for what we
need.
2023-06-08 00:05:00 -06:00
Thayne McCombs d6e9cbfff3 Merge pull request #1327 from sharkdp/dependabot/cargo/clap_complete-4.3.0
Bump clap_complete from 4.2.1 to 4.3.0
2023-06-01 16:38:29 -06:00
dependabot[bot] 8d3172f987 Bump clap_complete from 4.2.1 to 4.3.0
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.2.1 to 4.3.0.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.2.1...clap_complete-v4.3.0)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-01 22:37:51 +00:00
Thayne McCombs 5be58f0f76 Merge pull request #1326 from sharkdp/dependabot/cargo/once_cell-1.17.2
Bump once_cell from 1.17.1 to 1.17.2
2023-06-01 16:37:08 -06:00
Thayne McCombs 8d30d6a4fe Merge pull request #1328 from sharkdp/dependabot/cargo/anyhow-1.0.71
Bump anyhow from 1.0.70 to 1.0.71
2023-06-01 16:36:49 -06:00
Thayne McCombs 5ff866aa26 Merge pull request #1329 from sharkdp/dependabot/cargo/libc-0.2.144
Bump libc from 0.2.140 to 0.2.144
2023-06-01 16:36:33 -06:00
dependabot[bot] 4ecf013527 Bump libc from 0.2.140 to 0.2.144
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.140 to 0.2.144.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.140...0.2.144)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-01 17:57:32 +00:00
dependabot[bot] 1c3a38b423 Bump anyhow from 1.0.70 to 1.0.71
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.70 to 1.0.71.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.70...1.0.71)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-01 17:57:21 +00:00
dependabot[bot] a3a4912ced Bump once_cell from 1.17.1 to 1.17.2
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.17.1 to 1.17.2.
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.17.1...v1.17.2)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-01 17:56:55 +00:00
Thayne McCombs 0d32bebcc2 Merge pull request #1306 from sharkdp/dependabot/cargo/lscolors-0.14.0
Bump lscolors from 0.13.0 to 0.14.0
2023-05-03 23:34:34 -06:00
Thayne McCombs 0884b837b2 Merge pull request #1310 from sharkdp/dependabot/cargo/clap_complete-4.2.1
Bump clap_complete from 4.2.0 to 4.2.1
2023-05-02 01:15:19 -06:00
dependabot[bot] 11199079c3 Bump clap_complete from 4.2.0 to 4.2.1
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.2.0...clap_complete-v4.2.1)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-01 21:18:42 +00:00
Thayne McCombs 69521a1057 Merge pull request #1307 from sharkdp/dependabot/cargo/crossbeam-channel-0.5.8
Bump crossbeam-channel from 0.5.7 to 0.5.8
2023-05-01 15:17:54 -06:00
Thayne McCombs 59a487b524 Merge pull request #1308 from sharkdp/dependabot/cargo/test-case-3.1.0
Bump test-case from 3.0.0 to 3.1.0
2023-05-01 15:15:14 -06:00
dependabot[bot] 0e2a4bac72 Bump test-case from 3.0.0 to 3.1.0
Bumps [test-case](https://github.com/frondeus/test-case) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/frondeus/test-case/releases)
- [Changelog](https://github.com/frondeus/test-case/blob/master/CHANGELOG.md)
- [Commits](https://github.com/frondeus/test-case/compare/v3.0.0...v3.1.0)

---
updated-dependencies:
- dependency-name: test-case
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-01 17:57:14 +00:00
dependabot[bot] 35aa52538c Bump crossbeam-channel from 0.5.7 to 0.5.8
Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.7 to 0.5.8.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.7...crossbeam-channel-0.5.8)

---
updated-dependencies:
- dependency-name: crossbeam-channel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-01 17:57:08 +00:00
dependabot[bot] b680a9de9f Bump lscolors from 0.13.0 to 0.14.0
Bumps [lscolors](https://github.com/sharkdp/lscolors) from 0.13.0 to 0.14.0.
- [Release notes](https://github.com/sharkdp/lscolors/releases)
- [Commits](https://github.com/sharkdp/lscolors/compare/v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: lscolors
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-01 17:56:59 +00:00
Nathan Houghton 42244e5f32 Don't use jemalloc on OpenBSD (jemalloc fails to compile) 2023-04-14 21:24:19 +02:00
dependabot[bot] 072c9e56e1 Bump normpath from 1.1.0 to 1.1.1
Bumps [normpath](https://github.com/dylni/normpath) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/dylni/normpath/releases)
- [Commits](https://github.com/dylni/normpath/compare/1.1.0...1.1.1)

---
updated-dependencies:
- dependency-name: normpath
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 22:32:09 +02:00
dependabot[bot] f7bb60aba5 Bump clap_complete from 4.1.5 to 4.2.0
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.1.5 to 4.2.0.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.1.5...clap_complete-v4.2.0)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 20:38:12 +02:00
dependabot[bot] b019d8f1bf Bump tempfile from 3.4.0 to 3.5.0
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/Stebalien/tempfile/releases)
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/NEWS)
- [Commits](https://github.com/Stebalien/tempfile/commits)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 20:37:56 +02:00
dependabot[bot] 15c795d2e1 Bump nu-ansi-term from 0.46.0 to 0.47.0
Bumps [nu-ansi-term](https://github.com/nushell/nu-ansi-term) from 0.46.0 to 0.47.0.
- [Release notes](https://github.com/nushell/nu-ansi-term/releases)
- [Changelog](https://github.com/nushell/nu-ansi-term/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nushell/nu-ansi-term/compare/v0.46.0...v0.47.0)

---
updated-dependencies:
- dependency-name: nu-ansi-term
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-27 22:12:18 +02:00
dependabot[bot] a428f7eb13 Bump test-case from 2.2.2 to 3.0.0
Bumps [test-case](https://github.com/frondeus/test-case) from 2.2.2 to 3.0.0.
- [Release notes](https://github.com/frondeus/test-case/releases)
- [Changelog](https://github.com/frondeus/test-case/blob/master/CHANGELOG.md)
- [Commits](https://github.com/frondeus/test-case/compare/v2.2.2...v3.0.0)

---
updated-dependencies:
- dependency-name: test-case
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-27 22:10:47 +02:00
dependabot[bot] 02c9efba28 Bump regex from 1.7.1 to 1.7.3
Bumps [regex](https://github.com/rust-lang/regex) from 1.7.1 to 1.7.3.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.7.1...1.7.3)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-27 22:01:20 +02:00
dependabot[bot] aebe7537c3 Bump regex-syntax from 0.6.28 to 0.6.29
Bumps [regex-syntax](https://github.com/rust-lang/regex) from 0.6.28 to 0.6.29.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/commits)

---
updated-dependencies:
- dependency-name: regex-syntax
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-27 21:57:46 +02:00
Ryan Caezar Itang 4356ba3c43 Move Winget Releaser inside CICD workflow 2023-03-27 21:43:06 +02:00
Ryan Caezar Itang c9afbc5b70 Add Winget Releaser workflow 2023-03-27 21:43:06 +02:00
Ryan Caezar Itang e38e3078ac Add GitHub actions to Dependabot 2023-03-27 21:43:06 +02:00
David Peter 5439326aa4 CI updates 2023-03-27 21:39:10 +02:00
Thayne McCombs 35bc1f95fb Specifically set ignore version to 0.4.20 in Cargo.toml 2023-03-24 10:38:59 +01:00
Thayne McCombs 161ee64399 Merge pull request #1285 from tmccombs/doc-update
Add documentation and zsh updates
2023-03-21 18:36:01 -06:00
Thayne McCombs 399bf3a931 Add documentation and zsh updates
- Include --and in man page and zsh completions.
- Include --no-require-git and --changed-after to zsh completions

Fixes: #1282
2023-03-21 00:44:53 -06:00
Tavian Barnes bae0a1bfa6 Merge pull request #1284 from tmccombs/cargo-update
Cargo update
2023-03-20 09:45:28 -04:00
Tavian Barnes e4bca1033c Merge pull request #1283 from tmccombs/new-rust-version
A few changes to take advantage of the new MSRV
2023-03-20 09:44:55 -04:00
Thayne McCombs da40e76aae Run cargo update
To update transient dependencies.

Notably, this removes fs_extras, the current version of which has code
that rustc identifies as not being future compatible.
2023-03-20 01:28:43 -06:00
Thayne McCombs 31ac4a3f5c Bump MSRV to 1.67.0 2023-03-20 01:22:52 -06:00
Thayne McCombs 424d6efcc0 fix: Remove unnecessary collection into a vec. 2023-03-20 01:21:00 -06:00
Thayne McCombs ccf8e69650 fix: clippy warning for unnecessary closure
Now that MSRV is above 1.62, we can use `then_some` instead of a simple
closure.
2023-03-20 01:21:00 -06:00
Thayne McCombs ee44c1ed90 refactor: Use scoped threads from stdlib in spawn_receiver
This makes it so we don't need to use Arc as much.

Fixes #1141
2023-03-20 01:21:00 -06:00
David Peter 3ac2e13a25 Merge pull request #1255 from cha0ran/master
Update Chinese links
2023-03-12 22:41:18 +01:00
Thayne McCombs 06a6a118a1 Merge pull request #1269 from sharkdp/dependabot/cargo/normpath-1.0.1
Bump normpath from 0.3.2 to 1.0.1
2023-03-03 00:27:06 -07:00
Thayne McCombs c095867154 Merge pull request #1268 from sharkdp/dependabot/cargo/clap_complete-4.1.4
Bump clap_complete from 4.0.6 to 4.1.4
2023-03-03 00:26:30 -07:00
Tavian Barnes 324005fb3a Merge pull request #1273 from cyqsimon/rustfmt
Add empty `rustfmt.toml` to enforce default formatting
2023-03-02 09:47:27 -05:00
cyqsimon d8166907e6 Add comment on default in rustfmt.toml 2023-03-02 17:06:47 +08:00
cyqsimon 7cbfb8e29c Add empty rustfmt.toml to enfore default formatting 2023-03-02 17:05:15 +08:00
dependabot[bot] 1c5ce0a661 Bump clap_complete from 4.0.6 to 4.1.4
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.0.6 to 4.1.4.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.0.6...clap_complete-v4.1.4)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 19:48:23 +00:00
dependabot[bot] f98496abcd Bump normpath from 0.3.2 to 1.0.1
Bumps [normpath](https://github.com/dylni/normpath) from 0.3.2 to 1.0.1.
- [Release notes](https://github.com/dylni/normpath/releases)
- [Commits](https://github.com/dylni/normpath/compare/0.3.2...1.0.1)

---
updated-dependencies:
- dependency-name: normpath
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 19:47:08 +00:00
David Peter 82aa17f9fb Merge pull request #1270 from sharkdp/dependabot/cargo/ctrlc-3.2.4
Bump ctrlc from 3.2.3 to 3.2.4
2023-03-01 20:46:05 +01:00
David Peter 9b8457aeb3 Merge pull request #1271 from sharkdp/dependabot/cargo/once_cell-1.17.1
Bump once_cell from 1.17.0 to 1.17.1
2023-03-01 20:45:57 +01:00
dependabot[bot] 535b34e48a Bump once_cell from 1.17.0 to 1.17.1
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.17.0 to 1.17.1.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.17.0...v1.17.1)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 17:57:40 +00:00
dependabot[bot] 0909d413d0 Bump ctrlc from 3.2.3 to 3.2.4
Bumps [ctrlc](https://github.com/Detegr/rust-ctrlc) from 3.2.3 to 3.2.4.
- [Release notes](https://github.com/Detegr/rust-ctrlc/releases)
- [Commits](https://github.com/Detegr/rust-ctrlc/commits)

---
updated-dependencies:
- dependency-name: ctrlc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 17:57:35 +00:00
Thayne McCombs 284ee3d0c6 Merge pull request #1263 from jpcirrus/patch-1
Add flag `--no-require-git` to man page
2023-02-25 23:41:34 -07:00
John Purnell f3e6536d59 Add flag --no-require-git to man page
#1216 omitted to add the flag to the man page.
2023-02-26 11:41:19 +13:00
Tavian Barnes 002645d7ac Merge pull request #1262 from tmccombs/upcoming-changes
Add upcoming changes to changelog
2023-02-24 08:57:02 -05:00
Thayne McCombs 9f6abded0e Add upcoming changes to changelog 2023-02-24 01:27:15 -07:00
Thayne McCombs 840a565d3a Updates for 8.7.0 2023-02-24 00:14:46 -07:00
David Peter 3cf5ac0b9a Merge pull request #1256 from sitiom/patch-1
Add Winget installation reference
2023-02-04 08:51:38 +01:00
sitiom a217823510 Add Winget installation reference 2023-02-04 10:51:47 +08:00
Frank_Shek f867c28a2c Update Chinese links 2023-02-02 09:36:05 +08:00
David Peter 73a693ef28 Merge pull request #1244 from tmccombs/grouped-occurrences
update: Update to clap 4.1
2023-02-01 21:36:19 +01:00
David Peter 9955e20d01 Merge pull request #1253 from sharkdp/dependabot/cargo/nix-0.26.2
Bump nix from 0.25.0 to 0.26.2
2023-02-01 21:35:47 +01:00
David Peter 03052757a7 Merge pull request #1252 from sharkdp/dependabot/cargo/regex-1.7.1
Bump regex from 1.7.0 to 1.7.1
2023-02-01 21:35:39 +01:00
dependabot[bot] bdcc24ed04 Bump nix from 0.25.0 to 0.26.2
Bumps [nix](https://github.com/nix-rust/nix) from 0.25.0 to 0.26.2.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/v0.26.2/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.25.0...v0.26.2)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 17:02:24 +00:00
dependabot[bot] 8478a2c7eb Bump regex from 1.7.0 to 1.7.1
Bumps [regex](https://github.com/rust-lang/regex) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.7.0...1.7.1)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 17:02:07 +00:00
Thayne McCombs c34bfa30fe chore: Update MSRV to 1.64.0
To match clap 4.1
2023-01-18 23:00:03 -07:00
David Peter af9daff4ee Merge pull request #1216 from vegerot/pr1216
Add flag --no-require-git to always respect gitignore files
2023-01-17 14:37:14 +01:00
Thayne McCombs 10ba34f78b update: Update to clap 4.1
This includes switching to the stable API for getting values grouped by
occurrences, and updating tests to match the new error messages.
2023-01-17 00:17:50 -07:00
Thayne McCombs 503ede7535 Merge pull request #1212 from sharkdp/global-ignore-test
Add tests for global ignore file
2023-01-16 00:55:30 -07:00
Max 👨🏽‍💻 Coplan 08c0d427bf Add flag --no-require-git to always respect gitignore files
Summary: Currently, `--ignore-vcs` only serves to unset `--no-ignore-vcs`.
There is currently no way to tell fd to respect gitignore files when not in a
git repository.  This commit adds the flag `--no-require-git` to make fd always
respect all gitignore files.

This behaves the same as the `--no-require-git` option in [ripgrep](https://github.com/BurntSushi/ripgrep/blob/3bb71b0cb8727ac43237af78ba5c707298de0128/crates/core/app.rs#L2214-L2226)

This commit also contains an unrelated wording fix to CONTRIBUTING.md

Test Plan: `tests/tests.rs`

Background: I am using [Sapling](https://sapling-scm.com/docs/introduction/)
for working with git repositories (including this commit ☺️).  Since Sapling
uses `.sl` instead of `.git`, tools using the `ignore` crate (rg and fd) would show gitignored files.
I made a patch (https://github.com/vegerot/ripgrep/commit/ebf17eef22a04450ca86e9dc790db7cb00e11e52)
to `ignore` to respect gitignores with _either_ `.git` or `.sl`.  However,
@BurntSushi said he did not want to merge that patch and instead suggested I
use `--no-require-git` (https://github.com/BurntSushi/ripgrep/issues/2374).
This works fine, but I couldn't use this workaround for my other favorite tool!
That's what this patch is for 😁

(a follow-up patch will add a similar `FD_CONFIG_PATH` environment variable
like `RG_CONFIG_PATH`)
2023-01-13 13:52:34 -08:00
Thayne McCombs ab7d5eff87 Merge pull request #1220 from sharkdp/dependabot/cargo/regex-syntax-0.6.28
Bump regex-syntax from 0.6.27 to 0.6.28
2023-01-01 23:59:16 -07:00
Thayne McCombs 686318c005 Merge pull request #1221 from sharkdp/dependabot/cargo/nix-0.25.0
Bump nix from 0.24.2 to 0.25.0
2023-01-01 11:04:58 -07:00
Thayne McCombs c04ab74744 Merge pull request #1219 from sharkdp/dependabot/cargo/anyhow-1.0.68
Bump anyhow from 1.0.66 to 1.0.68
2023-01-01 10:50:37 -07:00
Thayne McCombs 8fdfc6c2ef Merge pull request #1222 from sharkdp/dependabot/cargo/once_cell-1.17.0
Bump once_cell from 1.15.0 to 1.17.0
2023-01-01 10:50:06 -07:00
dependabot[bot] 71393fa1be Bump regex-syntax from 0.6.27 to 0.6.28
Bumps [regex-syntax](https://github.com/rust-lang/regex) from 0.6.27 to 0.6.28.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/commits)

---
updated-dependencies:
- dependency-name: regex-syntax
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-01 17:49:30 +00:00
Thayne McCombs 5e50825af2 Merge pull request #1223 from sharkdp/dependabot/cargo/num_cpus-1.15.0
Bump num_cpus from 1.13.1 to 1.15.0
2023-01-01 10:48:42 -07:00
dependabot[bot] 8fed650de9 Bump num_cpus from 1.13.1 to 1.15.0
Bumps [num_cpus](https://github.com/seanmonstar/num_cpus) from 1.13.1 to 1.15.0.
- [Release notes](https://github.com/seanmonstar/num_cpus/releases)
- [Changelog](https://github.com/seanmonstar/num_cpus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/num_cpus/compare/v1.13.1...v1.15.0)

---
updated-dependencies:
- dependency-name: num_cpus
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-01 17:01:46 +00:00
dependabot[bot] 4d8569ad6b Bump once_cell from 1.15.0 to 1.17.0
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.15.0 to 1.17.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.15.0...v1.17.0)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-01 17:01:40 +00:00
dependabot[bot] 2f0677b556 Bump nix from 0.24.2 to 0.25.0
Bumps [nix](https://github.com/nix-rust/nix) from 0.24.2 to 0.25.0.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.24.2...v0.25.0)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-01 17:01:35 +00:00
dependabot[bot] 0a8a72d4f3 Bump anyhow from 1.0.66 to 1.0.68
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.66 to 1.0.68.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.66...1.0.68)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-01 17:01:23 +00:00
David Peter de611c8835 Merge pull request #1217 from tmccombs/skip-executable-test-if-root
Skip an executable test if running as root
2022-12-29 14:16:01 +01:00
Thayne McCombs a36f2cf61c Skip an executable test if running as root
Fixes #1214
2022-12-28 23:28:41 -07:00
Thayne McCombs b6c7ebc4f1 Don't test global ignore file on windows
Becase XDG_CONFIG_HOME doesn't work there.
2022-12-18 23:33:32 -07:00
Thayne McCombs fd707b42c2 Add tests for global ignore file 2022-12-18 00:42:54 -07:00
Thayne McCombs 7c86c7d585 Merge pull request #1211 from tmccombs/fix-global-ignore
Fix logic for when to read global ignore file
2022-12-17 11:46:18 -07:00
Thayne McCombs 27013537c9 Fix logic for when to read global ignore file
Fixes #1209
2022-12-17 00:28:47 -07:00
David Peter addf00cb16 Merge pull request #1206 from tmccombs/upstream-changes-pr
Add Upcoming release to changelog
2022-12-09 09:06:39 +01:00
Thayne McCombs 1964e434e6 Add Upcoming release to changelog 2022-12-09 00:19:22 -07:00
Thayne McCombs d5bca085dd Updates for 8.6.0 2022-12-08 23:41:24 -07:00
David Peter 8ecfdfee43 Merge pull request #1171 from tmccombs/clap-derive-comments
Use docstrings for long help in clap derive
2022-12-06 22:40:36 +01:00
Thayne McCombs b7a2f68d59 Mention --changed-after alias in long help 2022-12-06 01:28:15 -07:00
Thayne McCombs e98a6c6755 Use docstrings for long help in clap derive 2022-12-06 01:28:15 -07:00
David Peter 614e637dbc Merge pull request #1200 from tmccombs/more-resilient-full-path-tests
Change full path tests to be more resilient
2022-12-05 09:55:36 +01:00
Thayne McCombs 7ec795cd57 Change full-path tests to work on windows as well 2022-12-03 22:30:32 -07:00
Tavian Barnes 8f510265fc Merge pull request #1191 from sharkdp/chrono-without-time
Remove time from transitive dependencies of chrono
2022-12-03 09:57:44 -05:00
Thayne McCombs 39d80a59b6 Remove time from transitive dependencies of chrono
Because chrono was depending on an older version of time, and we don't
actually need it with recent versions of chrono.

Relates-To: #1188
Alernative-To: #1190
2022-12-03 01:28:17 -07:00
Tavian Barnes 6e3eb26af3 Merge pull request #1192 from tmccombs/ansi-term-deprecated
Use nu-ansi-term instead of ansi-term
2022-12-02 09:07:43 -05:00
Thayne McCombs 4a66d8fcd8 Merge pull request #1195 from sharkdp/dependabot/cargo/clap_complete-4.0.6
Bump clap_complete from 4.0.5 to 4.0.6
2022-12-01 23:58:17 -07:00
Thayne McCombs daa986ea35 Merge pull request #1196 from sharkdp/dependabot/cargo/libc-0.2.137
Bump libc from 0.2.136 to 0.2.137
2022-12-01 23:56:15 -07:00
Thayne McCombs 0a575763a1 Change full path tests to be more resilient
Use patterns that won't conflict with randomly generated portion of
temporary directory

Fixes: #1181
2022-12-01 22:02:19 -07:00
dependabot[bot] 547d08c1ef Bump libc from 0.2.136 to 0.2.137
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.136 to 0.2.137.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.136...0.2.137)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-02 04:57:40 +00:00
Thayne McCombs bbd66b3240 Merge pull request #1199 from sharkdp/dependabot/cargo/regex-1.7.0
Bump regex from 1.6.0 to 1.7.0
2022-12-01 21:53:19 -07:00
dependabot[bot] 2ddc2f6c18 Bump regex from 1.6.0 to 1.7.0
Bumps [regex](https://github.com/rust-lang/regex) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.6.0...1.7.0)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 17:02:43 +00:00
dependabot[bot] 58a9dde73f Bump clap_complete from 4.0.5 to 4.0.6
Bumps [clap_complete](https://github.com/clap-rs/clap) from 4.0.5 to 4.0.6.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.0.5...clap_complete-v4.0.6)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 17:01:56 +00:00
Thayne McCombs d441516c9d Use nu-ansi-term instead of ansi-term
Because ansi-term is no longer maintained.

Relates-To: #1188
2022-12-01 00:07:30 -07:00
Thayne McCombs d991beb942 Merge pull request #1189 from tmccombs/tempfile
Use tempfile instead of tempdir
2022-11-30 23:43:38 -07:00
Thayne McCombs 650a511fa4 Use tempfile instead of tempdir
Because tempdir is no longer maintained, because it has been combined
with the tempfile crate.

Relates-To: #1188
2022-11-30 02:26:16 -07:00
Thayne McCombs 2aa966cb3c Merge pull request #1183 from Ptipiak/integration-test-files-permission
Adding a simple test for executable files
2022-11-28 22:14:08 -07:00
Ptipiak cd5fad3cf3 Adding a simple test for executable files 2022-11-26 10:09:40 +01:00
David Peter c9d3968475 Merge pull request #1139 from Uthar/master
add support for matching multiple patterns
2022-11-21 21:19:08 +01:00
David Peter 36e60223eb Use allow_hyphen_values = true for --and <pattern> 2022-11-21 21:08:41 +01:00
David Peter 781bd4bcf2 Add CHANGELOG entry 2022-11-21 21:08:39 +01:00
David Peter 0d9926de40 Move --and option up to other patter-related options 2022-11-21 21:06:48 +01:00
David Peter e147ba901b Minor fixes in help text 2022-11-21 21:06:48 +01:00
Kasper Gałkowski 7e26925933 Added the --and flag for matching multiple patterns 2022-11-21 21:06:48 +01:00
David Peter 8dda499830 Merge pull request #1176 from tmccombs/changed-after
Add --changed-after alias.
2022-11-21 08:36:43 +01:00
Thayne McCombs 317a0c3cd3 Add entry for changed-after alias to CHANGELOG 2022-11-20 23:23:32 -07:00
Thayne McCombs 67cf524287 Add --changed-after alias.
And make some small tweaks to the help text and man page.

Closes: #982
2022-11-20 23:21:53 -07:00
David Peter db2590dca5 Merge pull request #1178 from tmccombs/windows-completion-fix
Use file_stem instead of file_name for command for completions
2022-11-18 08:11:04 +01:00
Thayne McCombs 64e642403e Use file_stem instead of file_name for command for completions
Fixes: #1177
2022-11-17 22:22:02 -07:00
David Peter 38cdeb0413 Merge pull request #1169 from Ptipiak/mention-executable-detection
Using faccess lib to detect executable files
2022-11-15 14:15:35 +01:00
David Peter 5c87ff524e Fix CHANGELOG 2022-11-15 14:15:19 +01:00
Ptipiak 88bebb8aac Using faccess lib to detect executable files
* The detection of executable files was not exactly the same as
the original find
2022-11-15 10:31:44 +01:00
Thayne McCombs d89b5755d9 Merge pull request #1175 from miles170/ci-macos-12
CI: replace macos-latest with macos-12
2022-11-14 21:12:12 -07:00
Miles Liu a3489674bf CI: replace macos-latest with macos-12 2022-11-14 16:15:35 +08:00
Thayne McCombs f6e74407e8 Merge pull request #1174 from sharkdp/v8.5.3-bump
Updates for fd 8.5.3
2022-11-13 23:54:36 -07:00
Thayne McCombs 41d775bedd Updates for fd 8.5.3 2022-11-13 23:23:04 -07:00
David Peter 45cb15d60f Merge pull request #1158 from miles170/ci-update-actions
CI: update actions to run on Node 16
2022-11-14 07:12:19 +01:00
Thayne McCombs ce4e8675ed Merge pull request #1173 from zappolowski/fix-completion-program-name
Use just the file name of the program name for generating completions
2022-11-13 22:11:10 -07:00
Bjoern Hiller 2fcfe7a5b7 Use just the file name of the program name
If passed a full path to the executable (like done in the Makefile) that
value is used in the generated completions. At least for fish this just
doesn't work.

This fixes #1172
2022-11-14 05:57:50 +01:00
Miles Liu fdab5da795 CI: using the bash shell to setup cargo cmd 2022-11-14 09:11:09 +08:00
Thayne McCombs 85e3adaf18 Merge pull request #1170 from tmccombs/clap-improvements-2
Clap improvements 2
2022-11-12 09:09:48 -07:00
Thayne McCombs 38d406876d Fix a couple small clippy warnings
- suppress warning about unused function on windows
- remove extraneous & in test
2022-11-11 02:12:58 -07:00
Thayne McCombs 84bf65e023 Use unit type for negating optins with clap_derive
As now supported by https://github.com/clap-rs/clap/pull/4371  and https://github.com/clap-rs/clap/pull/4459
2022-11-11 02:09:41 -07:00
Thayne McCombs 2c3e40c9d9 Use new Shell::from_env method in clap_complete
Instead of having an fd specific implementation.
2022-11-11 02:09:41 -07:00
Thayne McCombs 9e88f91c22 Merge pull request #1168 from tmccombs/clippy-fixes-2
Fix some warnings from clippy
2022-11-08 11:56:12 -07:00
Thayne McCombs 0773b3067e Fix some warnings from clippy
I'm guessing these are new warnings from the Rust 1.65 release
2022-11-08 01:09:06 -07:00
Thayne McCombs bba7e0acd8 Merge pull request #1167 from hadfl/anyhow
anyhow is not only used for the completions feature
2022-11-07 10:48:22 -07:00
Dominik Hassler 6ebc366146 anyhow is not only used for the completions feature 2022-11-07 17:11:00 +00:00
Miles Liu b389f41cb2 CI: add use of Swatinem/rust-cache 2022-11-04 15:18:34 +08:00
David Peter 56c405d8e6 Updates for fd 8.5.2 2022-11-03 09:13:15 +01:00
David Peter 99d1db8cb3 Merge pull request #1164 from tmccombs/owner-without-panic
Fix panic when using --owner
2022-11-03 09:08:09 +01:00
David Peter fbef976b92 Merge pull request #1159 from tmccombs/silence-large-variant
Silence warning about large enum variant
2022-11-03 08:54:52 +01:00
Thayne McCombs 55aae3a8c0 Silence warning about large enum variant
Because boxing the large variant is probably worse.
2022-11-03 00:56:56 -06:00
Thayne McCombs b04cae2ca0 Only run owner root test on linux
Because macos doesn't have a "root" user
2022-11-02 23:55:31 -06:00
Thayne McCombs c159ea2042 Fix panic when using --owner
Unfortunately, clap_derive can't combine a value_parser of Option<T>
with an optional argument to get a merged Option<T> so we need to do the
check for the nop outside of the value parser.

Also adds some tests for --owner

Fixes: #1163
2022-11-02 23:26:02 -06:00
David Peter 567ce2640f Update CHANGELOG 2022-11-02 13:48:18 +01:00
David Peter 527fe9e262 Updates for fd 8.5.1 2022-11-02 13:46:20 +01:00
David Peter 0a7b51ad42 Merge pull request #1162 from sharkdp/fix-threads-option
Fix --threads/-j option value parsing
2022-11-02 13:45:45 +01:00
David Peter f15be89bff Fix --threads/-j option value parsing 2022-11-02 13:32:22 +01:00
David Peter cbd11d8a45 Try to fix bug issue template 2022-11-02 13:15:55 +01:00
Miles Liu f52eaa92e4 CI: remove use of actions-rs/toolchain
actions-rs is currently inactive and has an issue like actions-rs/toolchain#219
2022-11-02 16:44:15 +08:00
Miles Liu f4c6d55b9d CI: remove use of actions-rs/cargo
actions-rs is currently inactive and has an issue like actions-rs/cargo#216
2022-11-02 16:44:15 +08:00
Miles Liu 5e7a870af6 CI: update actions/checkout to v3 2022-11-02 16:40:59 +08:00
Thayne McCombs 6b7f8da381 Merge pull request #1157 from miles170/ci-migrate-set-output
CI: migrate deprecating set-output commands
2022-11-02 00:50:46 -06:00
Miles Liu 8d1c3631cf CI: migrate deprecating set-output commands 2022-11-02 12:06:43 +08:00
David Peter c85929045e Update CHANGELOG 2022-11-01 21:36:56 +01:00
David Peter 715f0a9e44 Update release checklist 2022-11-01 21:36:30 +01:00
David Peter bab77275ec Update Usage in Readme 2022-11-01 21:18:11 +01:00
David Peter 12165c73f8 Reorder command line options 2022-11-01 21:17:48 +01:00
David Peter 70c4865191 Set max. term width to make help texts easier to read 2022-11-01 21:14:16 +01:00
David Peter 7f5bc9884f Add simple 'about' text 2022-11-01 21:02:37 +01:00
David Peter ac35b11dc8 Change clap CLI binary name to 'fd' 2022-11-01 21:00:32 +01:00
David Peter f8e832f212 Preparation for v8.5 2022-11-01 20:55:25 +01:00
David Peter bc94fcc90f Update CHANGELOG 2022-11-01 20:45:16 +01:00
David Peter b57ed11f65 Merge pull request #1137 from amesgen/batch-exit-code
Respect exit codes with `--exec-batch`
2022-11-01 20:42:28 +01:00
David Peter 831fe666fa Remove outdated TODO comment 2022-11-01 20:34:42 +01:00
David Peter 13a47c3a2c Merge pull request #1067 from tmccombs/clap-derive
Clap derive
2022-11-01 20:34:08 +01:00
David Peter 5771e74b95 Add newlines between options 2022-11-01 20:18:17 +01:00
David Peter 55029e889e Minor: add missing full stop 2022-11-01 20:13:32 +01:00
David Peter ebd48d406e Fix unit tests 2022-11-01 20:12:56 +01:00
David Peter 3f72ef4cdd Remove outdated TODO comment 2022-11-01 20:07:09 +01:00
David Peter 169d22fde2 Merge remote-tracking branch 'origin/master' into clap-derive 2022-11-01 20:00:16 +01:00
David Peter c6f9595a02 Update CHANGELOG 2022-11-01 19:57:11 +01:00
Tavian Barnes 5278405263 walk: Use a bounded queue.
Fixes #918.
2022-11-01 19:48:39 +01:00
Tavian Barnes 5bb7a52704 walk: Switch back to crossbeam-channel
Fixes #933.  Fixes #1060.  Fixes #1113.
2022-11-01 19:48:39 +01:00
Tavian Barnes 93e5488420 walk: Simplify the code in scan() a bit 2022-11-01 15:36:48 +01:00
Thayne McCombs 36ee44a3f6 Make help output more like what it was before use clap_derive
In particular, we specifically use `long_help` instead of doc comments
because using  doc comments will always trim the "." off the end of the
first paragraph, and will include the short help as the first paragraph
of the full help.
2022-11-01 02:30:22 -06:00
Thayne McCombs 8500c3193d Merge remote-tracking branch 'upstream/master' into clap-derive 2022-11-01 01:12:41 -06:00
Tavian Barnes cd8ec44abf Address review comments 2022-10-31 22:23:30 +01:00
Tavian Barnes 17d849df6c Compute colors in parallel 2022-10-31 22:23:30 +01:00
Tavian Barnes b2c8888a50 dir_entry: Implement file_name() for broken symlinks 2022-10-31 22:23:30 +01:00
Tavian Barnes f0c50befce Add a changelog entry 2022-10-31 22:23:30 +01:00
Tavian Barnes 7917c00887 dir_entry: Implement lscolors::Colorable 2022-10-31 22:23:30 +01:00
Vlad Kooklev c9f4dec2ed chore: Update outdated LICENSE year 2022-10-31 21:19:34 +01:00
Frieder Bluemle e9121ee515 Remove trailing spaces from README.md 2022-10-31 21:19:07 +01:00
Thayne McCombs 3782278f02 Improve help output 2022-10-20 00:34:52 -06:00
Thayne McCombs a3622ba294 Remove TODO comment
In favor of tracking scoped threads in #1141
2022-10-19 23:43:45 -06:00
Thayne McCombs aec125637b Fix format 2022-10-14 23:14:03 -06:00
amesgen cb95f1dcd5 Respect exit codes with --exec-batch 2022-10-13 23:33:54 +02:00
David Peter 4257034209 Add release checklist for maintainers 2022-10-13 22:52:09 +02:00
Thayne McCombs b6f0088b68 Change thread option to take u32 instead of usize
To simplify the option parsing.
2022-10-12 00:33:49 -06:00
Thayne McCombs c2115884de Fix deprecations from clap 4.0 2022-10-11 22:27:57 -06:00
Thayne McCombs c0b14705cd Update msrv to 1.60
Because that is what clap requires
2022-10-11 00:39:57 -06:00
Thayne McCombs bf1a6f6680 Update clap depenency version 2022-10-11 00:35:21 -06:00
Thayne McCombs 10ecb64ff3 Fix typo in test 2022-10-10 23:58:33 -06:00
Thayne McCombs aca64c09f8 Actually test if exec or exec-batch is used
By the time we check if we should strip the cwd, we've already moved the
command out of the options, so store if we got that out earlier.
2022-10-09 01:25:03 -06:00
Thayne McCombs 86c33492a7 Fix name of powershell in guess_shell 2022-10-09 01:05:27 -06:00
Thayne McCombs c41d61eeda Merge remote-tracking branch 'upstream/master' into clap-derive 2022-10-09 01:00:48 -06:00
Thayne McCombs 5b9e302e9b Support powershell when guessing shell for completions 2022-10-09 00:02:28 -06:00
Thayne McCombs f4c34b81c7 Upgrade to clap 4.0 2022-10-08 23:51:45 -06:00
Thayne McCombs a50e417c67 Add action clap attribute to fixed_strings 2022-10-08 00:42:11 -06:00
Thayne McCombs ff7336b202 clap derive suggestions from epage 2022-10-08 00:42:11 -06:00
Thayne McCombs e6f4805bae Fix clippy warnings 2022-10-08 00:42:11 -06:00
Thayne McCombs 066ce41299 Fix case of color options to ls 2022-10-08 00:42:11 -06:00
Thayne McCombs b7f5f4ac7d Improve help output after switch to clap-derive
Make it more like it used to be.
2022-10-08 00:42:11 -06:00
Thayne McCombs 4e7b403c1f Use clap-derive for option parsing
This makes the definition of arguments to fd a little more ergonomic,
and makes it easier to insure the types for the arguments are consitent.
2022-10-08 00:41:33 -06:00
Tavian Barnes 0984ed91ea Update CHANGELOG for -x/-X leading ./ change 2022-10-03 21:35:39 +02:00
Tavian Barnes 4ffc34956f Make --strip-cwd-prefix apply to -x/-X
Fixes #898.
2022-10-03 21:35:39 +02:00
Tavian Barnes 5039d2db99 Merge pull request #1123 from sharkdp/dependabot/cargo/once_cell-1.15.0
Bump once_cell from 1.14.0 to 1.15.0
2022-10-02 10:03:00 -04:00
Thayne McCombs ee2396b57a Merge pull request #1122 from sharkdp/dependabot/cargo/libc-0.2.134
Bump libc from 0.2.132 to 0.2.134
2022-10-01 14:04:22 -06:00
Thayne McCombs 5376676d07 Merge pull request #1125 from sharkdp/dependabot/cargo/anyhow-1.0.65
Bump anyhow from 1.0.64 to 1.0.65
2022-10-01 14:04:08 -06:00
dependabot[bot] 3f33b15e52 Bump anyhow from 1.0.64 to 1.0.65
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.64 to 1.0.65.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.64...1.0.65)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-01 17:02:33 +00:00
dependabot[bot] b1ee6e3046 Bump once_cell from 1.14.0 to 1.15.0
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.14.0 to 1.15.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.14.0...v1.15.0)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-01 17:02:24 +00:00
dependabot[bot] 46c38a827e Bump libc from 0.2.132 to 0.2.134
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.132 to 0.2.134.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.132...0.2.134)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-01 17:02:17 +00:00
David Peter 4f1bcfedf3 Update CHANGELOG 2022-09-27 21:25:10 +02:00
David Peter e3e6057434 Minor adaptation to help text 2022-09-27 21:00:29 +02:00
Scott Baker 12142008df Add a link back to Github to --help (but not -h) 2022-09-27 21:00:29 +02:00
Kamil Aronowski 8ccf21437b Mention EuroLinux 2022-09-27 20:59:31 +02:00
Tavian Barnes 4419401b6c Enable --strip-cwd-prefix by default except with -0
Fixes #1046.
2022-09-27 20:56:24 +02:00
Tavian Barnes e46d402ed1 Enable jemallocator on 64-bit musl builds
Partial fix for #710 and #980.
2022-09-19 21:10:05 +02:00
David Peter 9ea882d7cc Fix clippy suggestions 2022-09-11 21:29:43 +02:00
Thayne McCombs f63c463471 update dependencies 2022-09-11 21:27:42 +02:00
David Peter bd44c82404 Add CHANGELOG entry 2022-09-11 21:05:06 +02:00
David Peter 2569317ee8 Revert changes in help text, add /issues in manpage 2022-09-11 21:05:06 +02:00
Scott Baker cb91a5c848 Simplify some whitespace on lines 2022-09-11 21:05:06 +02:00
Scott Baker fcf8099587 Add Github URL to --help also 2022-09-11 21:05:06 +02:00
Scott Baker 97dfd8b428 Simplify some wording 2022-09-11 21:05:06 +02:00
Scott Baker c127dc89a5 Add a link back the Github page to address #1052 2022-09-11 21:05:06 +02:00
David Peter c48586de08 Add CHANGELOG entry 2022-09-11 20:58:50 +02:00
Marie Katrine Ekeberg d6b1d16bfc Use to_string_lossy to avoid relying on Debug-outputs 2022-09-11 20:58:50 +02:00
Marie Katrine Ekeberg 90e860c7a5 Update msrv 2022-09-11 20:58:50 +02:00
Marie Katrine Ekeberg c7370ca82c Simplistic "Command not found" error message 2022-09-11 20:58:50 +02:00
Tavian Barnes cbc6ddeefc Implement --type executable on Windows
Fixes #1051.
2022-09-11 20:46:19 +02:00
Thayne McCombs 45d6f55d3a Bump MSRV to 1.56.1
Because that is what is needed by clap 2
2022-09-09 00:19:44 -06:00
Thayne McCombs 6655356ce3 Upgrade clap to 3.2 2022-09-09 00:18:57 -06:00
Tom Eichlersmith 3e68733c94 add file-type requirement and redirect
as suggested by @sharkdp

Co-authored-by: David Peter <sharkdp@users.noreply.github.com>
2022-09-03 00:09:53 +02:00
Tom Eichlersmith c9db74bfd4 add md5sum example to README
this includes a statement that `fd` will not interlace or garble the terminal output from its multiple threads
2022-09-03 00:09:53 +02:00
David Peter ff77a2e29e Revert "Bump nix from 0.24.2 to 0.25.0"
This reverts commit 448ed6dfe5.
2022-09-02 10:56:48 +02:00
David Peter 19f5de51af Revert "Bump anyhow from 1.0.59 to 1.0.63"
This reverts commit 1550ec3ffc.
2022-09-02 10:56:47 +02:00
David Peter 9dc1b03905 Revert "Bump chrono from 0.4.19 to 0.4.22"
This reverts commit b1296d8557.
2022-09-02 10:56:46 +02:00
dependabot[bot] b1296d8557 Bump chrono from 0.4.19 to 0.4.22
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.19 to 0.4.22.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/v0.4.22/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.19...v0.4.22)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-02 09:13:03 +02:00
dependabot[bot] 1550ec3ffc Bump anyhow from 1.0.59 to 1.0.63
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.59 to 1.0.63.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.59...1.0.63)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-02 09:11:56 +02:00
dependabot[bot] 448ed6dfe5 Bump nix from 0.24.2 to 0.25.0
Bumps [nix](https://github.com/nix-rust/nix) from 0.24.2 to 0.25.0.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.24.2...v0.25.0)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-02 09:11:49 +02:00
dependabot[bot] a552b57d36 Bump lscolors from 0.11.0 to 0.12.0
Bumps [lscolors](https://github.com/sharkdp/lscolors) from 0.11.0 to 0.12.0.
- [Release notes](https://github.com/sharkdp/lscolors/releases)
- [Commits](https://github.com/sharkdp/lscolors/compare/v0.11.0...v0.12.0)

---
updated-dependencies:
- dependency-name: lscolors
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-02 09:11:31 +02:00
Thayne McCombs e17c592dec Merge pull request #1096 from sharkdp/dependabot/cargo/once_cell-1.13.1
Bump once_cell from 1.13.0 to 1.13.1
2022-09-01 22:12:23 -06:00
Thayne McCombs 441c726d47 Merge pull request #1095 from sharkdp/dependabot/cargo/ctrlc-3.2.3
Bump ctrlc from 3.2.2 to 3.2.3
2022-09-01 22:11:46 -06:00
Thayne McCombs 9ced5675d2 Merge pull request #1094 from sharkdp/dependabot/cargo/libc-0.2.132
Bump libc from 0.2.126 to 0.2.132
2022-09-01 22:10:55 -06:00
dependabot[bot] b984596e3c Bump once_cell from 1.13.0 to 1.13.1
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.13.0 to 1.13.1.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.13.0...v1.13.1)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 17:05:16 +00:00
dependabot[bot] 9c1b025695 Bump ctrlc from 3.2.2 to 3.2.3
Bumps [ctrlc](https://github.com/Detegr/rust-ctrlc) from 3.2.2 to 3.2.3.
- [Release notes](https://github.com/Detegr/rust-ctrlc/releases)
- [Commits](https://github.com/Detegr/rust-ctrlc/compare/3.2.2...3.2.3)

---
updated-dependencies:
- dependency-name: ctrlc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 17:05:13 +00:00
dependabot[bot] 65837a573e Bump libc from 0.2.126 to 0.2.132
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.126 to 0.2.132.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.126...0.2.132)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 17:05:09 +00:00
Sijmen a0062b9a1b Disable invalid CWD test on Windows 2022-08-10 20:01:21 +02:00
Sijmen 922f127aca Add test when running from non-existent directory
When fd is run from a non-existent directory, but a search path is
passed in the arguments, it should still run. This tests for that.
2022-08-10 20:01:21 +02:00
Sijmen cb6295d025 Move current_directory variable definition closer to usage 2022-08-10 20:01:21 +02:00
Sijmen a5f69579cf Update CHANGELOG 2022-08-10 20:01:21 +02:00
Sijmen fdcbb2f008 Allow working directory to be nonexistent if search path is given
Fixes #1072
2022-08-10 20:01:21 +02:00
Tavian Barnes ac934bd703 Merge pull request #1081 from sharkdp/dependabot/cargo/anyhow-1.0.59
Bump anyhow from 1.0.58 to 1.0.59
2022-08-02 12:45:47 -04:00
Tavian Barnes 3a4bb4f344 Merge pull request #1076 from sharkdp/dependabot/cargo/regex-1.6.0
Bump regex from 1.5.6 to 1.6.0
2022-08-02 12:45:08 -04:00
Tavian Barnes aed3bac71b Merge pull request #1073 from sharkdp/dependabot/cargo/test-case-2.2.1
Bump test-case from 2.1.0 to 2.2.1
2022-08-02 12:44:44 -04:00
dependabot[bot] e76402374f Bump anyhow from 1.0.58 to 1.0.59
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.58 to 1.0.59.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.58...1.0.59)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-02 07:19:43 +00:00
dependabot[bot] 41237e73a5 Bump once_cell from 1.12.0 to 1.13.0
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.12.0...v1.13.0)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-02 09:18:53 +02:00
dependabot[bot] bfba33a230 Bump filetime from 0.2.16 to 0.2.17
Bumps [filetime](https://github.com/alexcrichton/filetime) from 0.2.16 to 0.2.17.
- [Release notes](https://github.com/alexcrichton/filetime/releases)
- [Commits](https://github.com/alexcrichton/filetime/commits/0.2.17)

---
updated-dependencies:
- dependency-name: filetime
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-02 09:18:47 +02:00
Thayne McCombs e8615b88f9 Merge pull request #1078 from sharkdp/dependabot/cargo/nix-0.24.2
Bump nix from 0.24.1 to 0.24.2
2022-08-01 18:57:57 -06:00
dependabot[bot] b1763ba7db Bump regex from 1.5.6 to 1.6.0
Bumps [regex](https://github.com/rust-lang/regex) from 1.5.6 to 1.6.0.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.5.6...1.6.0)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 20:11:11 +00:00
dependabot[bot] 6219aa3b26 Bump nix from 0.24.1 to 0.24.2
Bumps [nix](https://github.com/nix-rust/nix) from 0.24.1 to 0.24.2.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.24.1...v0.24.2)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 20:10:50 +00:00
Thayne McCombs 218d475cb2 Merge pull request #1077 from sharkdp/dependabot/cargo/lscolors-0.11.0
Bump lscolors from 0.10.0 to 0.11.0
2022-08-01 14:09:58 -06:00
dependabot[bot] 00a1abbf43 Bump lscolors from 0.10.0 to 0.11.0
Bumps [lscolors](https://github.com/sharkdp/lscolors) from 0.10.0 to 0.11.0.
- [Release notes](https://github.com/sharkdp/lscolors/releases)
- [Commits](https://github.com/sharkdp/lscolors/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: lscolors
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 17:03:52 +00:00
dependabot[bot] f189d99b98 Bump test-case from 2.1.0 to 2.2.1
Bumps [test-case](https://github.com/frondeus/test-case) from 2.1.0 to 2.2.1.
- [Release notes](https://github.com/frondeus/test-case/releases)
- [Changelog](https://github.com/frondeus/test-case/blob/master/CHANGELOG.md)
- [Commits](https://github.com/frondeus/test-case/compare/v2.1.0...v2.2.1)

---
updated-dependencies:
- dependency-name: test-case
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 17:03:36 +00:00
SukkaW dc1b4ea720 CI: update macos runner version 2022-07-25 21:31:47 +02:00
Tavian Barnes 1b71425419 Merge pull request #1057 from sharkdp/dependabot/cargo/diff-0.1.13
Bump diff from 0.1.12 to 0.1.13
2022-07-01 14:40:37 -04:00
Tavian Barnes 791a66893e Merge pull request #1055 from sharkdp/dependabot/cargo/globset-0.4.9
Bump globset from 0.4.8 to 0.4.9
2022-07-01 14:40:20 -04:00
Tavian Barnes d298ce15cc Merge pull request #1054 from sharkdp/dependabot/cargo/anyhow-1.0.58
Bump anyhow from 1.0.57 to 1.0.58
2022-07-01 14:39:35 -04:00
dependabot[bot] 7c32932ada Bump diff from 0.1.12 to 0.1.13
Bumps [diff](https://github.com/utkarshkukreti/diff.rs) from 0.1.12 to 0.1.13.
- [Release notes](https://github.com/utkarshkukreti/diff.rs/releases)
- [Commits](https://github.com/utkarshkukreti/diff.rs/compare/0.1.12...0.1.13)

---
updated-dependencies:
- dependency-name: diff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 17:04:05 +00:00
dependabot[bot] 777b8a031b Bump globset from 0.4.8 to 0.4.9
Bumps [globset](https://github.com/BurntSushi/ripgrep) from 0.4.8 to 0.4.9.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/compare/globset-0.4.8...globset-0.4.9)

---
updated-dependencies:
- dependency-name: globset
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 17:03:56 +00:00
dependabot[bot] 4af4c8df44 Bump anyhow from 1.0.57 to 1.0.58
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.57 to 1.0.58.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.57...1.0.58)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 17:03:51 +00:00
Thayne McCombs d6e5ee2f63 Merge pull request #1050 from AllanDowney/patch-1
fix(_fd): fix zsh completion file `-V, --version`
2022-06-25 16:44:16 -06:00
allandowney a263b2e58e fix(_fd): fix zsh completion file -V, --version 2022-06-25 22:31:23 +08:00
Jonathan Goren f227bb291a apply workaround for #1003 2022-06-12 08:54:48 +02:00
Jonathan Goren b82e48f6da Update screencast 2022-06-12 08:54:48 +02:00
David Peter c47501ef7c Update jemalloc to 5.3 (jemallocator 0.5)
Benchmarks show that this is a tiny bit faster than what we had
previously.
2022-05-29 11:21:45 +02:00
David Peter 1d2d06ea25 Update dependencies 2022-05-29 11:21:45 +02:00
David Peter 33beb7fc64 Bump version 2022-05-29 11:21:45 +02:00
David Peter 8b96a1e99c Update documentation of --batch-size feature 2022-05-28 22:59:46 +02:00
David Peter f52dec11a4 Update CHANGELOG 2022-05-28 22:50:04 +02:00
David Peter 941f712975 Fix (pointless) clippy suggestion 2022-05-28 22:40:07 +02:00
David Peter 74d6990b4e Use cross to build x86_64-unknown-linux-gnu binaries to relax glibc requirements 2022-05-28 22:39:33 +02:00
David Peter 42e7e9ec64 Use minimal toolchain for clippy runs 2022-05-28 22:39:33 +02:00
Tavian Barnes 40b368e761 exec: Execute batches before they get too long
Fixes #410.
2022-05-28 22:19:47 +02:00
Amir Zolfaghari 16acdeb6ce remove description of --batch-size flag from EXAMPLES subsection
This also removes the indent before "SEE ALSO" to make it a new
subsection
2022-05-21 19:32:41 +02:00
Tavian Barnes 6782c21d52 Merge pull request #1019 from rtzoeller/nix_limit_features
Limit nix features
2022-05-18 10:22:37 -04:00
Ryan Zoeller d00c8ba0d8 Limit nix features
This removes memoffset as an indirect dependency and reduces clean build times slightly.
2022-05-17 22:00:44 -05:00
David Peter de27835264 Merge pull request #812 from yyogo/master
Append trailing path separators to directories
2022-05-15 16:53:20 +02:00
David Peter 41affe18c4 Merge remote-tracking branch 'origin/master' into yyogo/master 2022-05-15 16:31:06 +02:00
David Peter dcde6d358f Add CHANGELOG entry for multi exec 2022-05-15 16:26:44 +02:00
David Peter f57206a3a1 Update help text and man page 2022-05-15 16:22:24 +02:00
Jackson Theel f823eac672 Update CHANGELOG.md 2022-05-15 16:22:24 +02:00
Jackson Theel cbf3f11cf8 Make -u idempotent 2022-05-15 16:22:24 +02:00
Thayne McCombs 306cd99273 Merge pull request #1012 from sharkdp/dependabot/cargo/nix-0.24.1
Bump nix from 0.23.1 to 0.24.1
2022-05-02 09:57:52 -06:00
Thayne McCombs 6fed29eda2 Merge pull request #1013 from sharkdp/dependabot/cargo/libc-0.2.125
Bump libc from 0.2.121 to 0.2.125
2022-05-02 09:57:33 -06:00
dependabot[bot] 4fecbe4ede Bump libc from 0.2.121 to 0.2.125
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.121 to 0.2.125.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.121...0.2.125)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-02 04:49:25 +00:00
dependabot[bot] 3ad15721e0 Bump nix from 0.23.1 to 0.24.1
Bumps [nix](https://github.com/nix-rust/nix) from 0.23.1 to 0.24.1.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.23.1...v0.24.1)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-02 04:49:20 +00:00
Thayne McCombs 7ec7c56a01 Merge pull request #1015 from sharkdp/dependabot/cargo/anyhow-1.0.57
Bump anyhow from 1.0.56 to 1.0.57
2022-05-01 22:48:15 -06:00
Thayne McCombs d3dc18ba65 Merge pull request #1014 from sharkdp/dependabot/cargo/regex-1.5.5
Bump regex from 1.5.4 to 1.5.5
2022-05-01 22:47:30 -06:00
Thayne McCombs 8ab6dd3e45 Merge pull request #1016 from sharkdp/dependabot/cargo/ctrlc-3.2.2
Bump ctrlc from 3.2.1 to 3.2.2
2022-05-01 22:46:45 -06:00
dependabot[bot] b311b01336 Bump ctrlc from 3.2.1 to 3.2.2
Bumps [ctrlc](https://github.com/Detegr/rust-ctrlc) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/Detegr/rust-ctrlc/releases)
- [Commits](https://github.com/Detegr/rust-ctrlc/compare/3.2.1...3.2.2)

---
updated-dependencies:
- dependency-name: ctrlc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-01 23:50:02 +00:00
Thayne McCombs ecfcfe448d Merge pull request #1011 from sharkdp/dependabot/cargo/clap_complete-3.1.3
Bump clap_complete from 3.1.1 to 3.1.3
2022-05-01 17:48:56 -06:00
dependabot[bot] aa5c03834f Bump anyhow from 1.0.56 to 1.0.57
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.56 to 1.0.57.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.56...1.0.57)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-01 17:04:02 +00:00
dependabot[bot] 4269217e28 Bump regex from 1.5.4 to 1.5.5
Bumps [regex](https://github.com/rust-lang/regex) from 1.5.4 to 1.5.5.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.5.4...1.5.5)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-01 17:03:57 +00:00
dependabot[bot] 4e82809624 Bump clap_complete from 3.1.1 to 3.1.3
Bumps [clap_complete](https://github.com/clap-rs/clap) from 3.1.1 to 3.1.3.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v3.1.1...clap_complete-v3.1.3)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-01 17:03:39 +00:00
Bost cf4964d0f8 Update README.md
GuixOS installation instructions.
2022-04-20 22:49:52 +02:00
Hang Qian 3f6ff2ca32 Match against reference instead of value 2022-04-02 20:56:38 +02:00
ethsol bbd8c78861 Added installation instructions for RHEL8 2022-04-02 20:55:08 +02:00
ethsol 9d93807512 modification skeleton 2022-04-02 20:55:08 +02:00
ethsol 8a17ca25d6 Added install instructions for RHEL8 and clones
added chown for fd.1.gz, too
2022-04-02 20:55:08 +02:00
ethsol 6faf9ff1e0 Added install instructions for RHEL8 and clones 2022-04-02 20:55:08 +02:00
Tavian Barnes 37697f4ad3 Merge pull request #992 from sharkdp/dependabot/cargo/once_cell-1.10.0
Bump once_cell from 1.9.0 to 1.10.0
2022-04-01 22:12:16 -04:00
Thayne McCombs 36361c39d2 Merge pull request #991 from sharkdp/dependabot/cargo/anyhow-1.0.56
Bump anyhow from 1.0.55 to 1.0.56
2022-04-01 19:27:11 -06:00
Thayne McCombs 4349bfe985 Merge pull request #995 from sharkdp/dependabot/cargo/libc-0.2.121
Bump libc from 0.2.119 to 0.2.121
2022-04-01 15:07:48 -06:00
Thayne McCombs 2f9a858b2f Merge pull request #993 from sharkdp/dependabot/cargo/test-case-2.0.2
Bump test-case from 2.0.0 to 2.0.2
2022-04-01 13:49:14 -06:00
Thayne McCombs d64fca0a32 Merge pull request #994 from sharkdp/dependabot/cargo/clap-3.1.8
Bump clap from 3.1.5 to 3.1.8
2022-04-01 13:45:48 -06:00
dependabot[bot] 803ea0a0b1 Bump libc from 0.2.119 to 0.2.121
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.119 to 0.2.121.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.119...0.2.121)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-01 17:03:53 +00:00
dependabot[bot] cfa768755f Bump clap from 3.1.5 to 3.1.8
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.5 to 3.1.8.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.1.5...v3.1.8)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-01 17:03:48 +00:00
dependabot[bot] 9dcfa4a662 Bump test-case from 2.0.0 to 2.0.2
Bumps [test-case](https://github.com/frondeus/test-case) from 2.0.0 to 2.0.2.
- [Release notes](https://github.com/frondeus/test-case/releases)
- [Changelog](https://github.com/frondeus/test-case/blob/master/CHANGELOG.md)
- [Commits](https://github.com/frondeus/test-case/compare/v2.0.0...v2.0.2)

---
updated-dependencies:
- dependency-name: test-case
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-01 17:03:43 +00:00
dependabot[bot] 7ab29e17a3 Bump once_cell from 1.9.0 to 1.10.0
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-01 17:03:38 +00:00
dependabot[bot] 7d2740d6cd Bump anyhow from 1.0.55 to 1.0.56
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.55 to 1.0.56.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.55...1.0.56)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-01 17:03:35 +00:00
Jonathan Goren 60c14b1af2 make DirEntry Ord 2022-03-16 18:38:16 +02:00
Jonathan Goren 47e30d3d4a add actual path separator value to config 2022-03-16 18:13:05 +02:00
Thayne McCombs 38b84d08d7 Fix mistakes from resolving conflicts 2022-03-15 01:40:05 -06:00
Thayne McCombs 50c0fa812f Merge branch 'master' into master 2022-03-15 01:20:35 -06:00
Thayne McCombs 3e201de9b0 Merge pull request #983 from vegerot/patch-1
📝 Update README formatting
2022-03-14 12:25:40 -06:00
Max Coplan db2fd00c4a 📝 Update README formatting
Probably meant to use `code styling` instead of *italicizing*
2022-03-14 10:44:36 -07:00
Thayne McCombs c577b0838b Error out if no args provided to --exec or --exec-batch
Accepting multiple occurances means we need to check this ourselves. See
https://github.com/clap-rs/clap/issues/3542.
2022-03-08 10:15:48 +01:00
Thayne McCombs 5a12a5e421 Use full names in command.rs 2022-03-08 10:15:48 +01:00
Thayne McCombs 9f39f1d75b Add tests for multiple execs 2022-03-08 10:15:48 +01:00
Thayne McCombs 9fb0c5d372 Group together output from multi exec commands
So that if multiple `--exec` options are given, and the commands are run
in parallel, the buffered output for related commands will be
consecutive.
2022-03-08 10:15:48 +01:00
Thayne McCombs e54e352035 Add description of multiple --exec to man page 2022-03-08 10:15:48 +01:00
Thayne McCombs f27332ee8d Fix clippy lints 2022-03-08 10:15:48 +01:00
Thayne McCombs 0aee9b0fd9 Support multiple --exec instances
and `--exec-batch`.

Fixes: #406
2022-03-08 10:15:48 +01:00
Jacob Chapman 45f490a407 Looks like the COPR repo is no longer maintained
or only available on fedora rawhide
2022-03-08 07:41:46 +01:00
David Peter 0fd7ec5c2a Fix missing clap feature 2022-03-04 08:31:05 +01:00
dependabot[bot] ba473fc925 Bump lscolors from 0.8.1 to 0.9.0
Bumps [lscolors](https://github.com/sharkdp/lscolors) from 0.8.1 to 0.9.0.
- [Release notes](https://github.com/sharkdp/lscolors/releases)
- [Commits](https://github.com/sharkdp/lscolors/compare/v0.8.1...v0.9.0)

---
updated-dependencies:
- dependency-name: lscolors
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-04 08:31:05 +01:00
Thayne McCombs 6e5c8d9c20 Fix some clippy warnings 2022-03-04 08:30:41 +01:00
Thayne McCombs b29e87ec30 Merge pull request #976 from tmccombs/regex-doc
Regex doc
2022-03-03 23:23:01 -07:00
Tavian Barnes 7db25a7b23 Merge pull request #967 from tmccombs/clap-upgrade
Clap upgrade
2022-03-03 09:12:19 -05:00
Thayne McCombs bbdb8b9d9e Upgrade to clap 3.1
And fix deprecations
2022-03-02 23:32:04 -07:00
Thayne McCombs 6b8056ca86 More prominently document that fd uses regex by default
Fixes: #948
2022-03-02 00:50:41 -07:00
Thayne McCombs 5ec55eed96 Merge pull request #975 from sharkdp/dependabot/cargo/test-case-2.0.0
Bump test-case from 1.2.1 to 2.0.0
2022-03-02 00:28:07 -07:00
dependabot[bot] efedd9c4e0 Bump test-case from 1.2.1 to 2.0.0
Bumps [test-case](https://github.com/frondeus/test-case) from 1.2.1 to 2.0.0.
- [Release notes](https://github.com/frondeus/test-case/releases)
- [Changelog](https://github.com/frondeus/test-case/blob/master/CHANGELOG.md)
- [Commits](https://github.com/frondeus/test-case/compare/v1.2.1...v2.0.0)

---
updated-dependencies:
- dependency-name: test-case
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 20:29:59 +00:00
dependabot[bot] 4e0b193ab6 Bump anyhow from 1.0.53 to 1.0.55
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.53 to 1.0.55.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.53...1.0.55)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 21:28:23 +01:00
dependabot[bot] 1ac2c38b6b Bump libc from 0.2.116 to 0.2.119
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.116 to 0.2.119.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.116...0.2.119)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 21:27:50 +01:00
Thayne McCombs eb111aa835 Merge pull request #954 from sharkdp/dependabot/cargo/anyhow-1.0.53
Bump anyhow from 1.0.52 to 1.0.53
2022-02-01 12:25:48 -07:00
Thayne McCombs 25b6ac8b3e Merge pull request #953 from sharkdp/dependabot/cargo/clap_complete-3.0.5
Bump clap_complete from 3.0.2 to 3.0.5
2022-02-01 12:25:33 -07:00
Thayne McCombs cdd771a018 Merge pull request #952 from sharkdp/dependabot/cargo/clap-3.0.13
Bump clap from 3.0.5 to 3.0.13
2022-02-01 12:25:23 -07:00
Thayne McCombs ae861f7e4b Merge pull request #955 from sharkdp/dependabot/cargo/libc-0.2.116
Bump libc from 0.2.112 to 0.2.116
2022-02-01 12:25:10 -07:00
dependabot[bot] 43f683469b Bump libc from 0.2.112 to 0.2.116
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.112 to 0.2.116.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.112...0.2.116)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-01 17:03:47 +00:00
dependabot[bot] 2395e7cac5 Bump anyhow from 1.0.52 to 1.0.53
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.52 to 1.0.53.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.52...1.0.53)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-01 17:03:42 +00:00
dependabot[bot] abaed6686d Bump clap_complete from 3.0.2 to 3.0.5
Bumps [clap_complete](https://github.com/clap-rs/clap) from 3.0.2 to 3.0.5.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v3.0.2...clap_complete-v3.0.5)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-01 17:03:39 +00:00
dependabot[bot] 1844ed6b8c Bump clap from 3.0.5 to 3.0.13
Bumps [clap](https://github.com/clap-rs/clap) from 3.0.5 to 3.0.13.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v3.0.5...v3.0.13)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-01 17:03:32 +00:00
David Peter 9f5ed8534e Add temporary version of logo 2022-01-29 16:53:13 +01:00
David Peter c48d02e0a9 Bump version to v8.3.2 2022-01-29 16:49:09 +01:00
David Peter b3399c239b Add clippy run in CI/CD 2022-01-29 13:01:46 +01:00
David Peter 4377954cf9 Add tavianator sponsoring link 2022-01-29 12:51:16 +01:00
Thayne McCombs 125cb81a5b Merge pull request #929 from tmccombs/clap-upgrade
Upgrade to clap 3.0
2022-01-08 00:24:43 -07:00
Thayne McCombs 2e9be3e3f5 Bump MSRV to 1.54
Because that is needed by clap 3.0
2022-01-07 23:56:03 -07:00
Thayne McCombs 43f276e073 Upgrade to clap 3.0
This wasn't backwards compatible so required some more substantial
changes.
2022-01-07 23:56:03 -07:00
David Peter ec38e23d58 Add CHANGELOG entry 2022-01-07 17:39:24 +01:00
Tavian Barnes 56060a5b6b Merge pull request #936 from gbarta/fix_fd_issue_931
Update normpath to 0.3.2 to fix issue #931
2022-01-07 10:14:08 -05:00
Tavian Barnes 03548a847f Merge pull request #937 from tmccombs/less-flaky-tests
Less flaky tests
2022-01-07 10:11:54 -05:00
Thayne McCombs 06cd391845 Change test_opposing to be less flaky.
Make it resilient to the different invocations returning results in
different orders.
2022-01-07 03:10:09 -07:00
Gabriel Barta ef4abfc1d2 Update normpath to 0.3.2 to fix issue #931 2022-01-07 10:53:03 +11:00
David Peter 72895675ef Bump version to v8.3.1 2022-01-06 14:20:02 +01:00
David Peter ccc6cc54b2 Merge pull request #916 from tavianator/revert-crossbeam
Revert "Switch from std::sync::mpsc to crossbeam-channel"
2022-01-06 13:59:16 +01:00
David Peter aa1c0250b7 Update CHANGELOG 2022-01-06 13:59:04 +01:00
Thayne McCombs d5f740c9d3 Add a couple of options to zsh completion
--no-ignore-parent and --strip-cwd-prefix
2022-01-06 13:52:49 +01:00
David Peter aa6933d9e3 Merge branch 'master' into revert-crossbeam 2022-01-06 13:49:58 +01:00
dependabot[bot] c800c79976 Bump anyhow from 1.0.51 to 1.0.52
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.51 to 1.0.52.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.51...1.0.52)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-03 21:45:55 +01:00
dependabot[bot] 075c1af7d8 Bump num_cpus from 1.13.0 to 1.13.1 (#927)
Bumps [num_cpus](https://github.com/seanmonstar/num_cpus) from 1.13.0 to 1.13.1.
- [Release notes](https://github.com/seanmonstar/num_cpus/releases)
- [Changelog](https://github.com/seanmonstar/num_cpus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/num_cpus/compare/v1.13.0...v1.13.1)

---
updated-dependencies:
- dependency-name: num_cpus
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-03 09:47:20 -07:00
dependabot[bot] fbebaa299d Bump version_check from 0.9.3 to 0.9.4 (#921)
Bumps [version_check](https://github.com/SergioBenitez/version_check) from 0.9.3 to 0.9.4.
- [Release notes](https://github.com/SergioBenitez/version_check/releases)
- [Commits](https://github.com/SergioBenitez/version_check/compare/v0.9.3...v0.9.4)

---
updated-dependencies:
- dependency-name: version_check
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-03 09:26:25 -07:00
dependabot[bot] f6bbeb35f5 Bump nix from 0.23.0 to 0.23.1 (#922)
Bumps [nix](https://github.com/nix-rust/nix) from 0.23.0 to 0.23.1.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.23.0...v0.23.1)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-03 09:26:00 -07:00
dependabot[bot] 0dc49b07a0 Bump libc from 0.2.108 to 0.2.112 (#924)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.108 to 0.2.112.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.108...0.2.112)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-03 09:25:33 -07:00
dependabot[bot] c2e5075316 Bump once_cell from 1.8.0 to 1.9.0 (#925)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.8.0...v1.9.0)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-03 09:25:06 -07:00
Tavian Barnes e7f192f1c6 Revert "Switch from std::sync::mpsc to crossbeam-channel"
@sharkdp [noticed][1] a quite severe performance degredation due to this
change.  Switch back to std::sync::mpsc until we can fix the performance
regression.

This reverts commit a4bb734482.

[1]: https://github.com/sharkdp/fd/pull/895#issuecomment-1002099369
2021-12-28 12:11:32 -05:00
Yujia Qiao e5145ffb98 fix: disable jemalloc on risc-v target
`jemallocator` does not support risc-v and fails the compilation.
This fixes build for risc-v.
2021-12-28 17:38:28 +01:00
Ryan Lue 30add71233 Update manpage to match --help output
Three command line options were added in late 2021
that never made their way into the manpage:

* f8ae334 introduced --no-ignore-parent;
* bf9e6fd introduced --strip-prefix
  (later renamed strip-cwd-prefix); and
* 17dd2a6 introduced --batch-size.

This commit updates the manpage content to reflect
the auto-generated output of `fd --help`.
2021-12-28 14:21:10 +01:00
Thayne McCombs dade9736ac Add entry to changelog for no-ignore-vcs fix
I forgot to add it when I made the PR.

See commit 8bdbbd8e0cbe8ba010ce5c7f863e23af44386741
2021-12-28 14:20:25 +01:00
eatradish 639ed34791 Allow use to disable jemalloc
jemalloc will require special flags on devices where page size is not 4K. With default options fd will not work on a Mac Mini M1 where hardware only allow 16K paging size. This commit will allow the user to turn off jemalloc (using --no-default-features) under special circumstances where jemalloc is not usable.
2021-12-28 14:15:45 +01:00
David Peter da7ea79034 Use correct description for Debian package, closes #915 2021-12-28 14:00:36 +01:00
Thayne McCombs b7e077320d Fix logic for --no-ignore-parent (#908)
Make sure that using `--no-ignore-vcs` or `--no-ignore` don't also
enable `--no-ignore-parent`. So that if `--no-ignore-vcs` is enabled, it
continues to respect .fdignore and .ignore in the parent directories.

Fixes: #907
Fixes: #901
2021-12-22 23:38:00 -07:00
Jonathan Goren 22dbed0545 convert to path instead of cloning in batch exec
update changelog
2021-12-11 15:43:53 +02:00
Jonathan Goren 3dc61b5f28 rename module entry -> dir_entry 2021-12-11 15:43:52 +02:00
Jonathan Goren 1153e3e155 tests: fix for trailing slashes 2021-12-11 15:43:24 +02:00
Jonathan Goren a26bd3232c append trailing slash to folders
update changelog
2021-12-11 15:43:23 +02:00
Jonathan Goren 813a802b2c send DirEntries to output instead of just path 2021-12-11 15:42:07 +02:00
Tavian Barnes 81669f4c10 Merge pull request #902 from tavianator/quit-senders
Quit senders more aggressively
2021-12-10 13:56:28 -05:00
Thayne McCombs 5ea7cb7a05 A couple of minor recommendations from the Code Quality action (#903)
use derive for a Default impl, and use a function directly instead of
needlessly wrapping it in a closure
2021-12-07 10:04:17 -07:00
Tavian Barnes 4baefb2f5a walk: Split wants_to_quit into two separate flags
quit_flag is now used to quit the sender threads for any reason, either
due to an interrupt or because the receiver is done.

interrupt_flag is used specifically for ^C interrupts, and causes the
receiver to stop between printing paths, to avoid unfinished escape
sequences when colors are being used.

Fixes #867.
2021-12-05 12:06:49 -05:00
Tavian Barnes 97a8825b00 output: Remove wants_to_quit handling from print_entry()
Since we only check it once per path now, we might as well just check it
before printing anything.
2021-12-05 12:06:49 -05:00
Tavian Barnes 7fe4bfaacb Merge pull request #895 from tavianator/receiver-buffer
walk: Encapsulate the buffering behavior in a struct
2021-12-05 11:56:22 -05:00
dependabot[bot] 1a6638ba23 Bump anyhow from 1.0.48 to 1.0.51 (#899)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.48 to 1.0.51.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.48...1.0.51)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-01 13:58:36 -07:00
dependabot[bot] 8772708aa7 Bump clap from 2.33.3 to 2.34.0 (#900)
Bumps [clap](https://github.com/clap-rs/clap) from 2.33.3 to 2.34.0.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/commits)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-01 13:58:05 -07:00
Tavian Barnes a4bb734482 Switch from std::sync::mpsc to crossbeam-channel
This lets us avoid https://github.com/rust-lang/rust/issues/39364, which
could potentially be seen now that we're using recv_timeout().
2021-12-01 10:24:58 -05:00
Alexander Sieg 5fbfdfadb8 fix: disable jemalloc on FreeBSD
As jemalloc is the default system allocator on FreeBSD and the
jemalloc-sys crate failes to compile on FreeBSD, this fixes the build on
FreeBSD.
2021-11-28 17:42:15 +01:00
Tavian Barnes 16ae03c3b4 walk: Encapsulate the buffering behavior in a struct
The new ReceiverBuffer struct allows us to factor out the receiver
implementation into a number of helper methods.  The new implementation
uses rx.{recv,recv_timeout} instead of a for loop, which enables us to
switch to streaming mode at the right time without waiting for more
results.

Fixes #868.
2021-11-27 12:56:22 -05:00
David Peter 52f22557a5 Update usage section 2021-11-26 22:18:50 +01:00
David Peter 72cc9a876c Bump version 2021-11-26 22:18:50 +01:00
David Peter 5d06491370 Update CHANGELOG for v8.3 2021-11-26 22:18:50 +01:00
David Peter 67aaf82d37 Update dependencies 2021-11-26 22:18:50 +01:00
David Peter f219da4b3a Use non-sync channel 2021-11-26 21:23:47 +01:00
Thayne McCombs e990a13405 squash! Add buffering to stdout when it's not a terminal
Co-authored-by: sourlemon207 <jw1756@protonmail.com>
2021-11-26 21:23:47 +01:00
Thayne McCombs 7b7876e701 Add entry for buffering to CHANGELOG 2021-11-26 21:23:47 +01:00
Thayne McCombs feac240eb5 Add buffering to stdout when it's not a terminal
This is based on the work of #736 by @sourlemon207.

I've added the suggestion I recommended on that PR.
2021-11-26 21:23:47 +01:00
David Peter fba6db5096 Modify example to a realistic use case 2021-11-26 19:31:06 +01:00
tacoda f2eb1be678 Add an example of the -X option using rg 2021-11-26 19:31:06 +01:00
David Peter b211ded5de Merge pull request #861 from jcaplan/no-strip/760
show "./" prefix when search path provided
2021-11-26 19:27:44 +01:00
David Peter 92bd7850d0 Merge remote-tracking branch 'origin/master' into no-strip/760 2021-11-26 18:19:28 +01:00
David Peter 06c58b99f5 Update CHANGELOG 2021-11-26 17:58:18 +01:00
David Peter 776f8d0f11 Shorten short help text 2021-11-26 17:58:18 +01:00
David Peter 47421a49b8 Remove strip-prefix placeholders 2021-11-26 17:58:18 +01:00
David Peter f347379fb0 Adapt help text 2021-11-26 17:48:31 +01:00
David Peter 4d7e34ad59 Rename option to strip_cwd_prefix, rename CLI option 2021-11-26 17:46:04 +01:00
David Peter 359c0269ba Remove example from man page 2021-11-26 17:40:42 +01:00
David Peter 13cdfb32f8 Remove outdated comment 2021-11-26 17:40:07 +01:00
Shun Sakai 0484486f3f Remove lazy_static from dependencies 2021-11-25 20:06:43 +01:00
Jacob Mischka f32060b0de Change time comparisons to exclusive
Closes #794
2021-11-17 23:38:28 +01:00
Tavian Barnes fe992706ae Raise SIGINT when dying by ^C
Fixes #854.
2021-11-15 07:53:57 +01:00
Tavian Barnes 2b1bf471b1 Add an exit() method to ExitCode 2021-11-15 07:53:57 +01:00
David Peter cab31e280b Add missing single-tick in issue template 2021-11-15 07:38:48 +01:00
David Peter 088e42deef Improve --type help text
closes #823
2021-11-14 21:17:57 +01:00
David Peter ecdaf58e7f Update to latest lscolors dependency 2021-11-14 18:29:59 +01:00
David Peter fc2a972082 Add CHANGELOG entry 2021-11-14 17:42:16 +01:00
Tavian Barnes 66e3ccc5e1 Don't color each path component separately
It can be expensive to color each path component separately, requiring a
stat() call on each component.  For deep hierarchies this can result in
quadratic overhead.  Instead, just color the path up to the basename as
a directory.

Fixes #720.
2021-11-14 17:42:16 +01:00
David Peter 21fd013073 Improve --full-path documentation, closes #839 2021-11-14 17:16:44 +01:00
David Peter a539181f1f Merge pull request #822 from Asha20/pr/opposing-options
Add opposing CLI options
2021-11-14 16:55:13 +01:00
David Peter cdc6a37ed6 Merge remote-tracking branch 'origin/master' into pr/opposing-options 2021-11-14 16:47:53 +01:00
David Peter 2570fbd04e Add longer help text for --prune, closes #727 2021-11-14 16:29:10 +01:00
David Peter 690976380d Add section concerning aliases, shell functions
closes #870
2021-11-14 16:21:26 +01:00
David Peter 828649a30d Revert "Add pemistahl as a maintainer"
This reverts commit c06c9952b6.
2021-11-14 13:58:57 +01:00
Tavian Barnes 20dc7a984d Merge pull request #881 from cgjosephlee/master
fix zsh completion
2021-11-12 09:45:53 -05:00
Joseph Lee 653bc0e55d fix zsh completion 2021-11-11 23:30:01 +08:00
Tavian Barnes e8fe1508e2 Merge pull request #878 from sharkdp/bug-form
Change bug_report from an issue template to an issue form
2021-11-03 11:34:24 -04:00
Thayne McCombs fd493eb709 Change bug_report from an issue template to an issue form 2021-11-03 02:33:46 -06:00
Tavian Barnes f1b39d49c1 Merge pull request #877 from tmccombs/dep-update
Update some dependencies
2021-11-02 22:12:43 -04:00
Thayne McCombs 1236b1dbcf Update some dependencies
Combination of dependabot prs.
2021-11-01 22:41:56 -06:00
Devon Hollowood 17dd2a6dfe Implement --batch-size (#866) 2021-10-22 00:05:13 -06:00
Jonah Caplan bf9e6fd36e add -P option to strip prefix to tty 2021-10-17 00:29:51 -04:00
Jonah Caplan 46db1c4ef3 add {-} format for exec 2021-10-16 23:52:04 -04:00
Jonah Caplan b9cb5d54a4 fixup tests 2021-10-16 23:13:27 -04:00
Jonah Caplan a41021b0d2 use interactive_terminal 2021-10-16 14:34:58 -04:00
Jonah Caplan 82f04755bf hopefully fix build error on windows 2021-10-16 14:21:11 -04:00
Jonah Caplan c42bf4b904 don't strip paths for -X/x, and for tty output 2021-10-16 14:15:37 -04:00
Jonah Caplan fbc836b553 Revert -X stuff
This reverts commit 91860bf682.
2021-10-16 14:03:23 -04:00
Jonah Caplan 91860bf682 fmt 2021-10-16 00:02:37 -04:00
Jonah Caplan a4a4709320 rename Option to Config 2021-10-15 23:59:47 -04:00
Jonah Caplan b6f8bc8ff8 also handle -X and -x with no_strip 2021-10-15 23:57:03 -04:00
Jonah Caplan 782fc278aa add changelog entry 2021-10-15 23:57:03 -04:00
Jonah Caplan 12650a0913 add example to man page and correct test comment 2021-10-15 23:57:03 -04:00
Jonah Caplan 2e115df9e7 simplify check in prent_entry 2021-10-15 23:57:03 -04:00
Jonah Caplan 953f586f26 replace -N option with specifying '.' path 2021-10-15 23:57:03 -04:00
Jonah Caplan 08d913f167 cargo fmt fixup 2021-10-15 23:56:36 -04:00
Jonah Caplan 6b92c5db90 add -N/--no-strip option to show "./" prefix on relative paths 2021-10-15 23:56:36 -04:00
Tavian Barnes 7b5b3ec47b walk: Add a cache for DirEntry metadata 2021-10-13 09:13:44 +02:00
Niklas Mohrin 02e9850112 Refactor: Rename Options to Config 2021-10-12 18:49:07 +02:00
Niklas Mohrin b8c575cc8f Refactor: extract some methods out of run and reorder main.rs
Now, the top method is `main`, then comes `run`, then the methods used
in `run` follow. Generally, a method is always declared somewhere after
its first use. This way, you can read the file from top to bottom with
a decreasing level of abstraction (you start with very high-level
processes like setting the current dir and logic for which ls command to
use only comes furher down).
2021-10-12 18:49:07 +02:00
Niklas Mohrin 3de948ae0d Refactor: use some nice Rust methods in buffering code 2021-10-12 18:49:07 +02:00
Niklas Mohrin 45a86459b2 Refactor: merge_exit_codes now takes an impl IntoIterator<Item = ExitCode>
This way, callers don't need to collect into a slice / vec.
2021-10-12 18:49:07 +02:00
Niklas Mohrin a64a607fd8 Bump MSRV to 1.53 2021-10-12 18:49:07 +02:00
Thayne McCombs 00eb6461cb Remove an unnecessary reference. (#864)
This was caught by Code Quality github action with the message:

> this expression borrows a reference (`&walk::DirEntry`) that is immediately dereferenced by the compiler
2021-10-12 00:46:15 -06:00
dependabot[bot] feb969881b Bump libc from 0.2.101 to 0.2.103
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.101 to 0.2.103.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.101...0.2.103)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-08 22:49:44 +02:00
dependabot[bot] c06efe1317 Bump anyhow from 1.0.43 to 1.0.44
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.43 to 1.0.44.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.43...1.0.44)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-08 22:49:38 +02:00
Tavian Barnes 04fac46c5c Merge pull request #857 from exploide/short-help-completion
Added missing help messages to various options
2021-10-07 12:52:31 -04:00
Tavian Barnes e0d03d170e Merge pull request #858 from friederbluemle/fix-typo
Fix typos
2021-10-07 12:52:12 -04:00
Frieder Bluemle fd1c3d376e Fix typos 2021-10-06 18:38:50 +02:00
exploide c3f786db43 added missing help messages to various options
despite they have hidden_short_help set to true, a short help message is still useful for auto-generated completions
2021-10-03 17:06:09 +02:00
Niklas Mohrin a5f17db53a CI: Run clippy on stable and use msrv setting in clippy.toml 2021-09-03 07:36:12 +02:00
Tavian Barnes f1a5aa0887 Merge pull request #846 from tmccombs/dep-update
Update dependencies
2021-09-02 14:40:47 -04:00
Thayne McCombs 3c619afe30 Update dependencies
in Cargo.lock and Cargo.toml
2021-09-01 17:32:57 -06:00
Tavian Barnes 476d404938 Merge pull request #817 from will459/add_no_ignore_parent
Add --no-ignore-parent flag
2021-09-01 13:22:01 -04:00
William Correia 43f5c8adc9 Add tests for --no-ignore-parent 2021-08-31 18:04:42 -04:00
Vukašin Stepanović c749c95136 Merge branch 'master' into pr/opposing-options 2021-08-23 15:55:17 +02:00
Vukašin Stepanović 3ebd78cf02 Use overrides_with to clean up opposing arg logic 2021-08-23 15:44:11 +02:00
Vukašin Stepanović 8da936abd8 Merge branch 'pr/opposing-options' of https://github.com/Asha20/fd into pr/opposing-options 2021-08-23 15:28:45 +02:00
Vukašin Stepanović 668af05dca Add opposing options to manpage 2021-08-23 15:27:52 +02:00
David Peter 3ba90dd768 Remove --lib option 2021-08-22 16:06:04 +02:00
David Peter 87caef9513 Use --locked for cargo, enable 'cargo fmt' check 2021-08-22 16:06:04 +02:00
Thayne McCombs 78e21395b8 Make list of ignore files for --no-ignore more explicit 2021-08-15 12:52:10 +02:00
Thayne McCombs 1b52948e42 Add better documentation of vcs-ignore files.
Explicitly list which files are used for gitignore.

Fixes #354
2021-08-15 12:52:10 +02:00
Asha20 334488cab7 Add -q/--quiet/--has-match flag (#813)
Instead of printing to stdout, the program will return 1 as the exit
code if there are no matches and 0 otherwise.
2021-08-14 17:57:01 +02:00
a1346054 1c72f80ff5 fix whitespace 2021-08-14 16:21:02 +02:00
a1346054 5b4869a940 fix spelling 2021-08-14 16:21:02 +02:00
Thayne McCombs 9bc8fabba0 Update Cargo.lock 2021-08-11 01:48:42 -06:00
Thayne McCombs 8984e57dd6 Merge branch 'master' into pr/opposing-options 2021-08-11 01:44:51 -06:00
Thayne McCombs 049232439a Add item to CHANGELOG for no buffer with single thread 2021-08-11 09:38:55 +02:00
Thayne McCombs e4730603d0 Address feedback for removing buffering when running on a single thread 2021-08-11 09:38:55 +02:00
Max Triano 154cd6e329 Clarifying comments 2021-08-11 09:38:55 +02:00
Max Triano 394e967b5f No buffering cmd output when running on 1 thread 2021-08-11 09:38:55 +02:00
Max Triano 0f0fa76c81 Just trying some things out, initial functionality 2021-08-11 09:38:55 +02:00
Thayne McCombs 1795e0e9dd Add documentation and examples of ** in glob mode
And how it should be used with the `--full-path` option.

Fixes #764.
2021-08-10 20:53:56 +02:00
Thayne McCombs 500f404c4f Mention make as a build dependency.
Fixes #743
2021-08-10 20:41:02 +02:00
Klim Tsoutsman 6a18b36037 Support --list-details on more platforms
Implement `--list-details` by using short options for `ls` to support more platforms (like BusyBox)

closes #783
2021-08-10 20:39:10 +02:00
Thayne McCombs 115ae93df9 Refactor file types check to be on impl of FileTypes
Relates to #382
2021-08-10 20:30:23 +02:00
David Peter c06c9952b6 Add pemistahl as a maintainer 2021-08-09 23:06:00 +02:00
Peter Newman 42dce35dd7 Drop the 18.04 runs entirely 2021-08-09 16:48:06 +02:00
Peter Newman c2e4be3d12 Add 20.04 Ubuntu builds 2021-08-09 16:48:06 +02:00
Vukašin Stepanović 37852aa388 Add 5 opposing CLI options
Those are:
  - `--no-hidden`, which overrides `--hidden`
  - `--ignore`, which overrides `--no-ignore`
  - `--ignore-vcs`, which overrides `--no-ignore-vcs`
  - `--no-follow`, which overrides `--follow`
  - `--relative-path`, which overrides `--absolute-path`
2021-08-09 15:49:48 +02:00
Sean Joseph 25d7c4801f Changed to better whole word example 2021-08-09 13:42:45 +02:00
Sean Joseph d34e18a58c Added example for searching exactly a filename 2021-08-09 13:42:45 +02:00
Jacob Mischka ba60a163fe Use local times for time functions
This patch uses Chrono for explicit date or datetime parsing, only using
humantime for its relative time parsing. The following formats are accepted:

1. Full RFC3339 parsing, requiring an explicit timezone
2. `YY-MM-DD`, defaulting to time `00:00:00` for the given date in the
   local time zone
3. `YY-MM-DD HH:MM:SS` in the local time zone

Fixes #631, #794
2021-08-09 13:40:55 +02:00
himself65 4e04d13215 Fix return out of match pattern 2021-08-09 13:36:09 +02:00
David Peter c37592b0b7 Add tavianator as a maintainer 2021-08-09 07:34:26 +02:00
David Peter 224b7f2354 Silence wrong clippy warning 2021-08-08 23:48:20 +02:00
William Correia f8ae334ca9 Add --no-ignore-parent flag
- Flag toggles parent checking in the `ignore` crate.  This should
  affect both git and non-git ignore files.
- Updated Changelog.
2021-08-08 17:38:24 -04:00
David Peter b5344dac30 Improve -x/-X help text and man page description
closes #605
2021-08-08 22:58:13 +02:00
David Peter 018556a367 Add CHANGELOG entries 2021-08-08 15:04:28 +02:00
David Peter aeff525c30 Attempt to fix #365 2021-08-08 15:02:01 +02:00
David Peter 2d398dc4a7 Fix directory-existence check on Windows
This fixes a bug on Windows where `fd` could not be used on ram disks
and encrypted folders.

closes #752
2021-08-08 15:02:01 +02:00
David Peter 6e44828cc8 Add CHANGELOG entry 2021-08-08 13:13:58 +02:00
David Peter b507449146 Handle IO errors based on type, closes #737 2021-08-08 13:10:16 +02:00
David Peter d9697d1486 Make the path-separator check Windows-only 2021-08-08 13:03:31 +02:00
David Peter 515e0ee469 Do not use .clone() 2021-08-08 13:03:31 +02:00
David Peter a0ca460901 Adjust error message 2021-08-08 13:03:31 +02:00
Kaleb Olson 693325bcf2 Adds path separator checking and hint for automatic / expansion for some windows shells, eg., msys 2021-08-08 13:03:31 +02:00
dependabot[bot] ab81cad3b5 Bump regex from 1.4.6 to 1.5.4
Bumps [regex](https://github.com/rust-lang/regex) from 1.4.6 to 1.5.4.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.4.6...1.5.4)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-08 12:14:50 +02:00
dependabot[bot] 70850629e9 Bump globset from 0.4.6 to 0.4.8
Bumps [globset](https://github.com/BurntSushi/ripgrep) from 0.4.6 to 0.4.8.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/compare/globset-0.4.6...globset-0.4.8)

---
updated-dependencies:
- dependency-name: globset
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-08 12:14:41 +02:00
dependabot[bot] 8b0db189a1 Bump ctrlc from 3.1.7 to 3.1.9
Bumps [ctrlc](https://github.com/Detegr/rust-ctrlc) from 3.1.7 to 3.1.9.
- [Release notes](https://github.com/Detegr/rust-ctrlc/releases)
- [Commits](https://github.com/Detegr/rust-ctrlc/compare/3.1.7...3.1.9)

---
updated-dependencies:
- dependency-name: ctrlc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-08 11:48:54 +02:00
dependabot[bot] ad1b267601 Bump filetime from 0.2.13 to 0.2.14
Bumps [filetime](https://github.com/alexcrichton/filetime) from 0.2.13 to 0.2.14.
- [Release notes](https://github.com/alexcrichton/filetime/releases)
- [Commits](https://github.com/alexcrichton/filetime/compare/0.2.13...0.2.14)

---
updated-dependencies:
- dependency-name: filetime
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-08 11:48:47 +02:00
dependabot[bot] 04829c287d Bump anyhow from 1.0.35 to 1.0.42
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.35 to 1.0.42.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.35...1.0.42)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-08 11:43:15 +02:00
dependabot[bot] ca92bea0d7 Bump version_check from 0.9.2 to 0.9.3
Bumps [version_check](https://github.com/SergioBenitez/version_check) from 0.9.2 to 0.9.3.
- [Release notes](https://github.com/SergioBenitez/version_check/releases)
- [Commits](https://github.com/SergioBenitez/version_check/compare/v0.9.2...v0.9.3)

---
updated-dependencies:
- dependency-name: version_check
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-08 11:43:01 +02:00
dependabot[bot] 252beb8df7 Bump libc from 0.2.80 to 0.2.98
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.80 to 0.2.98.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.80...0.2.98)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-08 11:42:55 +02:00
dependabot[bot] b80764b19a Bump regex from 1.4.2 to 1.4.6
Bumps [regex](https://github.com/rust-lang/regex) from 1.4.2 to 1.4.6.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.4.2...1.4.6)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-08 11:27:36 +02:00
Daniel Bast 148fa64a73 Change dependabot interval to monthly 2021-08-08 11:15:18 +02:00
Daniel Bast 6ce55624f7 Add dependabot config for cargo updates 2021-08-08 11:15:18 +02:00
David Peter 708efaa812 Literal separators 2021-07-27 09:05:23 +02:00
David Peter a7a4499d1d Fix unneeded references 2021-07-27 09:05:23 +02:00
David Peter 2a2126c40a Fix clippy warnings 2021-07-27 09:05:23 +02:00
David Peter db30bfc2b7 Update README.md 2021-07-26 22:34:03 +02:00
David Peter 81a051f07c Fix shell completion path 2021-07-26 22:33:27 +02:00
David Peter 95d6470956 Fix stripping on arm musl target 2021-07-26 22:33:27 +02:00
David Peter e59a2001cc Fix shell completion path 2021-07-26 22:33:27 +02:00
David Peter c60338a28b Adapt test options 2021-07-26 22:33:27 +02:00
David Peter 16464a35b1 Fix man page path 2021-07-26 22:33:27 +02:00
David Peter 1d85e31260 Migrate to GitHub actions 2021-07-26 22:33:27 +02:00
Thayne McCombs 024309f378 Add comment to README about making sure .local/bin is on PATH (#797)
To make it more clear how to set up the symlin on debian/ubuntu.

Fixes #791
2021-07-20 09:05:01 -06:00
Luca Poldelmengo ac4ded5b27 Add explanation for musl releases 2021-06-20 10:26:58 +02:00
Sudeshna Sur c9873b4b82 A few spell-checks is required in the readme file
fd is a program to find entries in your 'filesytem'. It must be filesystem instead :)
2021-05-25 06:35:46 +02:00
Kaspar 07ebce9419 Add rofi to integration with other programs in README.md
As discussed in ISSUE #753
2021-05-13 11:40:10 +02:00
Delapouite f60b7687a2 doc: add link to GNU parallel 2021-03-14 20:10:47 +01:00
Andrew Mitchell cb385a4822 Issue 624 newer older help text (#733)
* Document the newer and older aliases in the help text

* Documentation for new older aliases, remove commas

* Adds better clarification on alias usage for newer and older

* Fixes inconsistencies in help text for newer and older aliases
2021-02-25 07:39:44 +01:00
David Peter efc71bc00b Update CHANGELOG 2021-02-15 22:53:50 +01:00
Allen Wild 1a3615df9c set default path separator to '/' in MSYS
MSYS and MSYS2 environments (such as Git Bash) have a UNIX like
filesystem which uses '/' as the path separator rather than '\', but
Rust doesn't know about this by default.

On Windows, check the MSYSTEM environment variable and set the default
value of the --path-separator option to '/' for convenience.

There is no similar detection of Cygwin because there seems to be no way
for Rust (and any native Win32) programs to detect that they're being
called from a Cygwin environment. Cygwin users can use a shell
alias/function/script to wrap fd.

Fixes: https://github.com/sharkdp/fd/issues/537
2021-02-15 20:08:59 +01:00
David Peter cf7dd43f80 Hide --print0 from the short help text 2021-02-14 20:02:37 +01:00
David Peter 4ebb3bbc81 Explain what will be executed 2021-02-14 19:59:53 +01:00
David Peter d283aba52e Move command execution section 2021-02-14 19:51:10 +01:00
David Peter 5423c45660 Update command execution section 2021-02-14 19:50:50 +01:00
David Peter 98738d2ac1 Remove xargs section from How-to 2021-02-14 11:27:44 +01:00
David Peter 371794047a Update features section 2021-02-14 11:22:10 +01:00
David Peter c43c931985 Update intro 2021-02-14 11:17:04 +01:00
David Peter 41dc622fb5 Update features section 2021-02-14 11:07:44 +01:00
David Peter 266ba7893a Add quick links 2021-02-14 11:03:24 +01:00
David Peter 194dbe2033 Move benchmark and CLI sections 2021-02-14 10:57:09 +01:00
David Peter 97f1558daf Move colorized output section to 'Troubleshooting' 2021-02-14 10:55:30 +01:00
David Peter f00af363d1 Fix section heading levels 2021-02-14 10:52:53 +01:00
David Peter 2155d19be0 Change section header 2021-02-14 10:51:40 +01:00
David Peter 3e728f3edd Update LICENSE terms => 2021 2021-02-14 10:51:30 +01:00
David Peter 6645131234 Integrate regex link into text 2021-02-14 10:47:34 +01:00
Travis Stewart 189d6a907a Move and update Parallel command execution section 2021-02-14 10:45:26 +01:00
David Peter 8a83ad41c8 Remove alias suggestions 2021-02-14 10:44:52 +01:00
Chinmay 5feb89aa99 README update: Use soft link instead of alias for Debian.
As export command will not work with fd because fd is just an alias to
fdfind, create a soft link instead of alias.

Addresses https://github.com/sharkdp/fd/issues/728
2021-02-14 10:44:52 +01:00
Allen Wild 8a532e5196 use custom --path-separator in arguments to --exec
When --path-separator is used, pass it on to commands run with
--exec(-batch) and --list-details.

On Windows, paths with drive letters (C:\foo) and UNC paths
(\\server\share\path) are handled as expected, though they're unlikely
to be found in normal usage of fd.

Fixes: https://github.com/sharkdp/fd/issues/697
2021-02-14 10:24:41 +01:00
johnwdjiang b8089f8d58 hide private func 2021-02-13 21:55:38 +01:00
David Peter 85fb7389af Shorter help text for --exec 2021-02-13 21:25:50 +01:00
Archer Stéphane eb28030f87 include similar change to src/app.rs after feeback 2021-02-13 21:24:15 +01:00
Archer Stéphane 5d2e011e90 change documentation message after feedbacks 2021-02-13 21:24:15 +01:00
Archer Stéphane 64bde11887 Try to clarify the documentation for -x command
see issue #712
2021-02-13 21:24:15 +01:00
Richard Taityr b928af7d9c fix typo (#723) 2021-02-02 22:37:36 -07:00
Chathika Weerasuriya 9bc20e38b1 fixed: typographic error in help
- Changed "extention" to "extension"
2021-01-15 19:33:34 +01:00
sharkdp 6a3aae52fd Bump version to v8.2.1 2020-12-07 19:01:36 +01:00
Travis Stewart 7dc81381b0 Move Installation and Development below Tutorial (#701) 2020-12-07 06:54:00 +01:00
sharkdp c7cf2d1104 Revert using 'cleanup', we are still using dpl v1 2020-12-06 19:06:33 +01:00
sharkdp 91eaff056f Update CHANGELOG 2020-12-06 16:04:37 +01:00
sharkdp cadaef3f07 Show error if pattern matches leading dot but --hidden is not given, closes #615 2020-12-06 15:57:33 +01:00
sharkdp 17bd256ae6 Improve --fixed-strings help text, closes #627 2020-12-06 14:57:47 +01:00
sharkdp ecfd8cea41 Update --help text regarding pattern, closes #684 2020-12-06 12:31:31 +01:00
sharkdp d2659de782 Improve --extension help text, closes #673 2020-12-06 12:20:50 +01:00
sharkdp d205a7ff9e Improve --exclude help text, closes #661 2020-12-06 12:15:01 +01:00
sharkdp 296300ce46 Fix clippy suggestions 2020-12-06 12:04:47 +01:00
sharkdp ea48a96945 Run cargo fmt 2020-12-06 12:02:22 +01:00
sharkdp f2fec45099 Update dirs-next and users dependency 2020-12-06 12:02:04 +01:00
sharkdp 4faa201c89 Update dependencies 2020-12-06 12:00:11 +01:00
sharkdp 54603501ec Bump version 2020-12-06 11:56:36 +01:00
sharkdp 45c66e7f1b Update CHANGELOG 2020-12-06 11:54:54 +01:00
xanonid 441a235a0f Simplify code a bit (suggestions by clippy) 2020-12-06 11:52:10 +01:00
xanonid 2cd3de8b94 Use NO_COLOR env variable check also for help screen 2020-12-06 11:52:10 +01:00
Marco Sirabella 6830b3dee9 Better defaults for LsColors 2020-12-06 11:48:19 +01:00
Platon Pronko f3edaf0e4d add changelog entry for exact file sizes in --size filter 2020-12-06 11:47:27 +01:00
Platon Pronko e97a1e90cb Add exact size support to the --size filter (#669) 2020-12-06 11:47:27 +01:00
Andreas Lappe 2338b3bc81 Fix typo in fd.1 2020-12-04 12:04:19 +01:00
sharkdp 9412648ee9 Add link to troubleshooting section 2020-12-01 19:44:13 +01:00
sharkdp 0a22dcc044 Add CHANGELOG section to CONTRIBUTING.md 2020-12-01 19:38:05 +01:00
Nick Flueckiger 24402dda7c Remove .UE and .UR to fix url display on macos 2020-11-06 21:44:21 +01:00
Nicholas Bailey 4f8697c407 Update README to have updated instructions. 2020-10-30 08:09:06 +01:00
sharkdp b2fa188029 Avoid panic when sending errors after receiver shutdown
fixes #678
2020-10-28 13:10:25 +01:00
David Peter e0adb45d08 Fail with error message if numeric arguments can not be parsed
closes #675
2020-10-25 21:18:53 +01:00
Matthias Reitinger ec4cc981fc Add --prune flag
closes #535
2020-10-25 08:16:01 +01:00
Amrit Rathie 06eb231fbd Update lockfile 2020-10-24 15:25:07 +02:00
Amrit Rathie fd1ddc9d08 Change dependency dirs to dirs-next 2020-10-24 15:25:07 +02:00
Matthias Reitinger e852009876 Add NO_COLOR to the man page 2020-10-24 12:15:06 +02:00
Allen Wild 99934ab98c add --base-directory, --path-separator, and --search-path to the man page
These options are in `fd --help` but missing from the man page.
Also fix a typo in the help text for --base-directory.
2020-10-14 08:35:09 +02:00
Craig Hills 633d486ac1 Adjust the regex syntax reference wording 2020-10-14 08:34:06 +02:00
Craig Hills 4d2472bfab Add documentation around regex syntax
This is to address https://github.com/sharkdp/fd/issues/622
2020-10-14 08:34:06 +02:00
Fredrik Fornwall a851570b15 Disable jemalloc on Android (fixes #636 and #642)
Disabling jemalloc for Android fixes a build failure since jemalloc does
not build out of the box for that platform on older API versions.

Android started using jemalloc as the system allocator around 2014 for
most devices. In the latest Android version (11) the system allocator
has been switched to Scudo, which while not being jemalloc is modern and
actively maintained and should be used for most software on Android.

See:
- https://android-developers.googleblog.com/2020/06/system-hardening-in-android-11.html
- https://blog.nsogroup.com/a-tale-of-two-mallocs-on-android-libc-allocators-part-2-jemalloc/
- https://stackoverflow.com/questions/2266762/android-libc-version-and-malloc-implementation
2020-10-08 12:45:48 +02:00
sharkdp f064e41bf1 Update CHANGELOG 2020-10-05 23:30:00 +02:00
Sebastián Mancilla ef1bfc7508 Add native Zsh completion
Replace the auto-generated Zsh completion with a full completion script.
This script improves completion support for options and arguments,
which is hard to obtain from an auto-generated completion.

- Full completion support for external commands and options when using
  `--exec`/`--exec-batch`.

- The completion for `--type` and `--color` adds descriptions instead of
  just values.

- Complete files when using `--ignore-file`.

- Stop completing files for the pattern argument.

- Improve completion for path arguments. Only directories are
  completed.

- Single-use options are not offered again.

- Updated exclusions lists for mutual-exclusive options.

- Add support for hidden options (as defined in `app.rs`). They are not
  offered for completion, but if present are considered (and their value
  may be completed).

Full support for exclusion lists depends of options groups, which was
added in Zsh 5.4. Older Zsh versions, as commented in the completion
script, will just offer most options.

The format of the completion script was taken from ripgrep completion
script. Command completion for `--exec`/`--exec-batch` was taken from
Zsh's `_find` completion.
2020-10-05 22:39:17 +02:00
Matthias Reitinger a38da63a34 Replace aliases in Travis config 2020-10-04 21:50:49 +02:00
Matthias Reitinger 9a49d0d6d0 Fix deprecated Travis config keys
* root: deprecated key sudo (The key `sudo` has no effect anymore.)
* deploy: deprecated key skip_cleanup (not supported in dpl v2, use
  cleanup)
2020-10-04 21:50:49 +02:00
gorogoroumaru 74c3431a2b improve time option usage (#645)
* improve time option usage
2020-09-10 00:34:27 -06:00
yuuji.yaginuma 1b4e1e9c1a Fix a link to ubuntu official page
Currently, https://packages.ubuntu.com/disco/fd-find shows an error.
This is because of the package page that unsupported version was removed.

So I removed the version from the link. That link shows a search result of `fd-find`
and can find OSs that can install `fd-find`.
2020-08-08 07:46:45 +02:00
David Peter 6f2c8cdf91 Add tmccombs as maintainer 2020-06-10 07:42:49 +02:00
David Peter e2f90dba44 Update LS_COLORS help text 2020-05-25 16:47:51 +02:00
sharkdp 5648597a61 Bump version to 8.1.1 2020-05-25 15:38:30 +02:00
sharkdp b3258e00df Update CHANGELOG 2020-05-25 15:37:03 +02:00
sharkdp 41d7cc33ca Add CHANGELOG entry 2020-05-25 12:17:32 +02:00
sharkdp a81fef9992 Windows: Check for xterm-256color environment variable as a proxy for color support 2020-05-25 12:17:32 +02:00
sharkdp 53c338d71f Windows: Always enable colors if --color=always is set 2020-05-25 12:17:32 +02:00
Dmitry Marakasov d77daa89a2 Merged into single project in repology 2020-05-24 17:25:52 +02:00
sharkdp 78cde856b1 Update dependencies 2020-05-19 18:01:51 +02:00
sharkdp a954944d69 Prepare 8.1.0 release 2020-05-19 17:58:07 +02:00
sharkdp 27162c2729 Update CHANGELOG 2020-05-19 17:57:14 +02:00
sharkdp 1d1eefdb7b Disable jemalloc on macOS
This is a workaround for #498. See issue for details.

closes #498
2020-05-19 17:55:21 +02:00
sharkdp c8746f6216 Use macOS 10.15.4 (Catalina) for Travis build 2020-05-19 17:55:21 +02:00
sharkdp c761d51dfb Add CHANGELOG entry 2020-05-19 17:09:27 +02:00
sharkdp ddee6aa8f3 Revert "Always enable colors on Windows, closes #469"
This reverts commit a4e78519c4.
2020-05-19 17:09:27 +02:00
sharkdp e3c77ef7f5 Update --size documentation
closes #584
2020-05-19 17:06:32 +02:00
sharkdp c0592e276e Disable caching on Travis 2020-05-19 16:24:06 +02:00
sharkdp d41a5a9e24 Update CHANGELOG 2020-05-19 15:57:47 +02:00
sharkdp 726fede7cc Code formatting 2020-05-19 15:57:47 +02:00
sharkdp 9d3cb69935 Minor refactoring 2020-05-19 15:57:47 +02:00
DJRHails da9af8c1eb Improve consistency of linting 2020-05-19 15:57:47 +02:00
DJRHails dc120c547d Add error checking on missing test case 2020-05-19 15:57:47 +02:00
DJRHails bbf3d0d430 Update testenv to support errors that don't fail 2020-05-19 15:57:47 +02:00
DJRHails 4f4591bfdc Correct Err return to prevent panic 2020-05-19 15:57:47 +02:00
DJRHails 28d6a4f518 Check for no valid search paths to prevent panic 2020-05-19 15:57:47 +02:00
DJRHails 42719624a8 Refactor to for-loop 2020-05-19 15:57:47 +02:00
DJRHails fef1b91feb Remove test assertion covered by existing tests 2020-05-19 15:57:47 +02:00
DJRHails c5a311d3cc Allow for missing directories 2020-05-19 15:57:47 +02:00
DJRHails ca2ef7ba82 Add a test for a single missing search path 2020-05-19 15:57:47 +02:00
sharkdp 65b65b32be Update lockfile 2020-05-19 14:01:22 +02:00
sharkdp 3283a7b345 Fix warning 2020-05-19 14:01:00 +02:00
sharkdp 4cafb28951 Update CHANGELOG 2020-05-18 21:20:23 +02:00
Bobbie Soedirgo 79d5a5bdc5 Add global fdignore support 2020-05-18 21:19:09 +02:00
Alexandru Macovei a9dc45ecb1 [ownership] document --owner in manpage and changelog 2020-05-18 21:11:33 +02:00
Alexandru Macovei 1a16003cca [ownership][errs] ':' and '' args to --owner result in noop; reject strings with more than one ':' 2020-05-18 21:11:33 +02:00
Alexandru Macovei 6a68ac8c27 [ownership] add help text for --owner 2020-05-18 21:11:33 +02:00
Alexandru Macovei 09cdf9831d [ownership] parse leading exclamation mark as negation of ownership component 2020-05-18 21:11:33 +02:00
Alexandru Macovei 22a55361e0 [ownership] change uid/gid storage to tristate enum for negation 2020-05-18 21:11:33 +02:00
Alexandru Macovei d7cc34e36f [ownership] depend on users 0.10.0 on unix; parse user and group names 2020-05-18 21:11:33 +02:00
Alexandru Macovei 4f9a02400a [ownership] add --owner arg parsing and storage 2020-05-18 21:11:33 +02:00
Alexandru Macovei 30cb4adc61 [ownership] initial struct, parsing, and test framework 2020-05-18 21:11:33 +02:00
Jake Zimmerman daf3046a35 Add as-tree to the README
Suggested in this comment:

    https://github.com/sharkdp/fd/issues/283#issuecomment-627465260
2020-05-13 08:16:02 +02:00
Alex Kitchens 151eaad043 Fix "unnecessary braces" warning
Original warning:
```
warning: unnecessary braces around block return value
 --> src/filter/size.rs:5:39
  |
5 |     static ref SIZE_CAPTURES: Regex = { Regex::new(r"(?i)^([+-])(\d+)(b|[kmgt]i?b?)$").unwrap() };
  |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these braces
  |
  = note: `#[warn(unused_braces)]` on by default

warning: 1 warning emitted
```
2020-05-10 21:27:55 +02:00
Alexandru Macovei 4f4330167a Fix some clippy lints, and format 2020-05-01 14:08:53 +02:00
sharkdp f31fb9bf68 Update CHANGELOG 2020-04-26 22:02:24 +02:00
Seamus Connor b22285ffe4 Fix --glob behavior with empty pattern
With an empty pattern, --glob results in no matches. This does not
align with the behavior of --fixed-strings or --regex. Update the
initialization code to handle globs with empty patterns.
2020-04-26 22:01:29 +02:00
David Peter db6fc44d05 Add packaging status to README 2020-04-24 12:40:55 +02:00
sharkdp 90de7242c7 Update CHANGELOG 2020-04-17 21:39:09 +02:00
Tobias Kortkamp 04bcd546b2 Also add NetBSD and OpenBSD 2020-04-16 20:33:32 +02:00
Tobias Kortkamp 4b5e8941a7 Fix --list-details on FreeBSD 2020-04-16 20:33:32 +02:00
sharkdp fe00860b87 Add issue templates 2020-04-16 11:24:24 +02:00
sharkdp 0335cc362b Do not allow list-details in combination with -1 2020-04-16 10:11:05 +02:00
sharkdp a06efe1418 Update USAGE section 2020-04-16 10:02:29 +02:00
sharkdp 1a96544b29 Remove two options from short -h help text 2020-04-16 10:02:29 +02:00
sharkdp ee1a9f567f Bump version to 8.0 2020-04-16 10:02:29 +02:00
sharkdp 17fbc2dc52 Update CHANGELOG 2020-04-16 10:02:29 +02:00
sharkdp 074de44caf Update dependencies 2020-04-16 10:02:29 +02:00
sharkdp cb56add1d8 Add new --type socket and --type pipe filters
closes #511
2020-04-16 09:59:45 +02:00
sharkdp 4287cddc00 Add test 2020-04-15 23:32:28 +02:00
sharkdp 0b7febc3b6 Windows support (if GNU ls is installed) 2020-04-15 23:32:28 +02:00
sharkdp d91100e354 Add comment why we prefer gls 2020-04-15 23:32:28 +02:00
sharkdp 0f5500adfc Do not show output of 'gls --version' 2020-04-15 23:32:28 +02:00
sharkdp 2685728695 Add MacOS support for -l/--list-details 2020-04-15 23:32:28 +02:00
sharkdp 789706c3ab Update CHANGELOG 2020-04-15 19:33:02 +02:00
sharkdp 4a0730a5fa Update CHANGELOG 2020-04-15 19:23:59 +02:00
sharkdp 3b42898a69 Always enable colors on Windows, closes #469 2020-04-15 19:23:59 +02:00
sharkdp d63c63be8c Add --min-depth and --exact-depth
Add new `--min-depth <depth>` and `--exact-depth <depth>` options in addition to the existing
option to limit the maximum depth.

closes #404
2020-04-15 17:02:41 +02:00
sharkdp 47974b6479 --glob: '*' does not match on path separators 2020-04-15 16:41:56 +02:00
Danny Mösch 2bab4a2249 Add alias -1 for --max-results=1 2020-04-10 21:39:30 +02:00
sharkdp 95eae00126 Fix test on Windows 2020-04-04 18:46:08 +02:00
sharkdp ed024ceb54 Remove code duplication, add feature gate 2020-04-04 18:46:08 +02:00
sharkdp 6c9e743d43 Print path as raw bytes, allowing invalid UTF-8 filenames to be passed to other processes 2020-04-04 18:46:08 +02:00
sharkdp ea21df3f76 Add tests originally written by @alexmaco in #309 2020-04-04 18:46:08 +02:00
sharkdp 7e3c69c096 Reimplement dirname, basename, remove_extension for OsStr 2020-04-04 18:46:08 +02:00
sharkdp 439548c25a panic => unreachable 2020-04-04 18:46:08 +02:00
sharkdp ed45d1c5af Remove duplicate 'strip prefix' function 2020-04-04 18:46:08 +02:00
sharkdp e44f2f8540 Rewrite replace_path_separator function 2020-04-03 23:01:57 +02:00
sharkdp 2ea77e7cdc Add TODOs, move function 2020-04-03 22:51:41 +02:00
sharkdp a85f33cf98 Clean up build.rs 2020-04-03 22:36:32 +02:00
sharkdp 4815ee416e Remove process::exit instance 2020-04-03 22:36:32 +02:00
sharkdp 53557ef471 Clean up include order 2020-04-03 22:36:32 +02:00
sharkdp f9372b55d5 Remove irrelevant TODO 2020-04-03 22:36:32 +02:00
sharkdp 4590ae8535 Proper error handling within walk.rs 2020-04-03 22:36:32 +02:00
sharkdp bce95274e3 Proper error handling in main.rs 2020-04-03 22:36:32 +02:00
sharkdp af9d8082a1 Better error message 2020-04-03 22:36:32 +02:00
sharkdp 094516aec3 Refactor directory handling 2020-04-03 22:36:32 +02:00
sharkdp 33eb857a81 Cleanup 2020-04-03 22:36:32 +02:00
sharkdp 6e96154d86 Add tests for strip_current_dir 2020-04-03 22:36:32 +02:00
sharkdp 556c40e1f4 Move strip_current_dir 2020-04-03 22:36:32 +02:00
sharkdp b415d7234b Rename fshelper to filesystem 2020-04-03 22:36:32 +02:00
sharkdp e0cba4b700 Remove 'internal' module 2020-04-03 22:36:32 +02:00
sharkdp 342d12db3f Remove possibility to use '--exec <cmd>' with a single dash 2020-04-03 22:36:32 +02:00
sharkdp c79d1638f5 Move MAX_BUFFER_LENGTH 2020-04-03 22:36:32 +02:00
sharkdp 9ef9bf7b80 Add tests for regex_helper 2020-04-03 22:36:32 +02:00
sharkdp 809fd8fb78 Move regex helpers to new module 2020-04-03 22:36:32 +02:00
sharkdp a3060f952e Move error macros to error.rs 2020-04-03 22:36:32 +02:00
sharkdp 65096a653e Move FdOptions to Options 2020-04-03 22:36:32 +02:00
sharkdp 9f738ad995 Move filter up from internal 2020-04-03 22:36:32 +02:00
sharkdp 5c27ab1a06 Move filetypes up from 'internal' 2020-04-03 22:36:32 +02:00
sharkdp 2cfb1a2bb2 Adapt --list-details help message 2020-04-03 11:28:01 +02:00
sharkdp 938dafda28 Clean up unused help texts 2020-04-03 11:26:20 +02:00
sharkdp e2a7d3446b Inline the help texts 2020-04-03 11:24:47 +02:00
sharkdp e42ddda5a6 Clean up exit code handling 2020-04-03 10:48:27 +02:00
sharkdp 289d6443a7 Use .write_all 2020-04-03 10:37:53 +02:00
sharkdp 3066445e6b Remove empty line 2020-04-03 10:36:05 +02:00
sharkdp 364555fd71 Clean up Cargo.toml 2020-04-03 10:35:30 +02:00
sharkdp 80b042ad47 Clean up CI files 2020-04-03 10:26:15 +02:00
sharkdp 4274075f6f Remove outdated license headers (not strictly required by Apache-2.0) 2020-04-03 10:19:13 +02:00
sharkdp b9d0e72f70 Solve clippy issues 2020-04-03 10:08:47 +02:00
sharkdp 33df48ebe4 Remove claim about unique search results 2020-04-03 10:07:46 +02:00
sharkdp c9dc617711 Rename --list to --list-details 2020-04-03 09:58:47 +02:00
sharkdp da5cd12b24 Add -l/--list option
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)
2020-04-03 09:58:47 +02:00
sharkdp 1714d416e2 Fix test on Windows 2020-04-02 20:27:41 +02:00
sharkdp d43827fe57 Add --max-results=<count> option
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 #472
closes #476
2020-04-02 20:27:41 +02:00
David Peter ee673c92d3 Added changes for upcoming release 2020-04-02 16:58:27 +02:00
David Peter decd7f2ea3 Update CHANGELOG.md 2020-04-02 16:54:19 +02:00
David Peter f3e1ea150c Add CHANGELOG 2020-04-02 16:53:12 +02:00
spearkkk 12bd321a27 Add link for Korean 2020-04-01 17:08:12 +02:00
sharkdp 5fc341832d Update lscolors dependency, closes #552 2020-04-01 11:25:18 +02:00
sharkdp dd07bc9ef1 Bump min. required Rust version to 1.36 2020-03-22 16:19:28 +01:00
sharkdp 2340bab32a Update README 2020-03-22 15:58:21 +01:00
sharkdp 4a237c591e Update humantime dependency 2020-03-22 15:56:52 +01:00
sharkdp 44605d55dd Use .to_string() instead of .description() 2020-03-22 15:54:43 +01:00
sharkdp e5e14f31c4 Bump version to 7.5.0 2020-03-22 15:48:55 +01:00
sharkdp f69b59195a Update dependencies, closes #437 2020-03-22 15:47:06 +01:00
David Peter 9c9bb12f23 Update README.md 2020-03-19 22:57:22 +01:00
Dave Parfitt 70448b0006 honor the NO_COLOR env var 2020-03-19 22:56:28 +01:00
sharkdp fc924d2e0a Remove custom .github folder 2020-03-16 07:53:49 +01:00
Caleb Webber cab4981b11 Add --one-file-system and aliases to man page (#548) 2020-03-15 22:03:51 +01:00
sharkdp 104600e642 Update links 2020-03-15 12:03:46 +01:00
Adam Smith 3c6fab3439 Fix homebrew formula link 2020-03-14 14:36:54 +01:00
sharkdp d05e7171d4 Fix for older versions of Rust 2020-02-28 20:42:14 +01:00
sharkdp 81dee25438 Add additional check for symlink 2020-02-28 20:42:14 +01:00
sharkdp bbf0f1cc1f New implementation of broken-symlink handling 2020-02-28 20:42:14 +01:00
sharkdp bfc8c42444 Revert back to master state 2020-02-28 20:42:14 +01:00
sharkdp 918dfc6ef0 Add expected behavior as unit tests 2020-02-28 20:42:14 +01:00
sharkdp d6034119ae Add comment for broken symlinks 2020-02-28 20:42:14 +01:00
sharkdp 82e6562cfc Further simplify the code 2020-02-28 20:42:14 +01:00
sharkdp 8cea65c1b8 Simplify match statement 2020-02-28 20:42:14 +01:00
Tom Milligan 9d73402ef2 walk: catch ignore NotFound error in the case of a broken symlink 2020-02-28 20:42:14 +01:00
Tom Milligan 06434f229b test: we should find broken symlink with and without --follow 2020-02-28 20:42:14 +01:00
fusillicode 0f2429cabc Add unit tests for merge_exitcodes 2020-02-22 12:32:35 +01:00
fusillicode 232e3937f2 Rename error_if_any_error to merge_exitcodes 2020-02-22 12:32:35 +01:00
fusillicode e23398e6d0 Extract error_if_any_error as free function 2020-02-22 12:32:35 +01:00
fusillicode a5fe138a25 Extract ExitCode::is_error helper 2020-02-22 12:32:35 +01:00
fusillicode b23cfc383f Switch back from Self to ExitCode 2020-02-22 12:32:35 +01:00
fusillicode e46998278a Fix typo in a job.rs comment 2020-02-22 12:32:35 +01:00
fusillicode 7213f5a88e Add collection of job & thread exit codes + default to ExitCode::Error if any ExitCode::Error 2020-02-22 12:32:35 +01:00
fusillicode fa7d49282b Restun exit code for generate_and_execute? 2020-02-22 12:32:35 +01:00
sharkdp 2f18903b29 Fix zsh autocompletion problem, closes #487 2020-02-06 21:52:09 +01:00
sharkdp b63e43b40f Remove .snapcraft.yaml. This never worked. 2020-02-06 21:38:50 +01:00
Shun Sakai 56289041a6 Fix LICENSE
- Add copyright notice to the MIT License.
- Add information about the license to README file.
2020-01-19 19:06:21 +01:00
David Peter 8196f79fa4 Show master build state 2020-01-12 11:06:04 +01:00
MarcoIeni 320d7fca0a Sort search results when using -X option 2020-01-02 21:52:26 +01:00
sharkdp f7d1938556 Formatting 2020-01-01 12:05:50 +01:00
sharkdp 328c6640be Formatting 2020-01-01 12:05:33 +01:00
sharkdp c001dd47a7 Hide --one-file-system from the short help text 2020-01-01 11:54:01 +01:00
sharkdp a9c7696ecc Small stylistic change 2020-01-01 11:54:01 +01:00
Simon Engmann 9a34ba6a0c Credit the source of the device_num() function 2020-01-01 11:54:01 +01:00
Simon Engmann cd2dc5714e Compare --one-file-system to find's -mount/-xdev 2020-01-01 11:54:01 +01:00
Simon Engmann 2828d90f99 Don't assume that /dev/null exists in test
If `/dev/null` doesn't exist or is not on a different partition during
the test for `--one-file-system`, the test is skipped instead of
mistakenly failing.
2020-01-01 11:54:01 +01:00
Simon Engmann ed6c184020 Shorten cfg!() checks 2020-01-01 11:54:01 +01:00
Simon Engmann 6f7d10870c Add aliases for --one-file-system
The functionality provided by `--one-file-system` is called
`-mount`/`-xdev` under `find`, so provide those aliases as a compromise.
2020-01-01 11:54:01 +01:00
Simon Engmann dea1fbe722 Restrict --one-file-system to supported systems
Instead of having the option do nothing at runtime on unsupported
platforms, it is now only available on the systems that support it in
the first place.
2020-01-01 11:54:01 +01:00
Simon Engmann 94993ca6c2 Rename --same-file-system to --one-file-system 2020-01-01 11:54:01 +01:00
Simon Engmann 3e0325cc60 Adjust tests to not time out on Travis OSX 2020-01-01 11:54:01 +01:00
Simon Engmann e5ba75f3c8 Add tests for --same-file-system 2020-01-01 11:54:01 +01:00
Simon Engmann 8796de57b5 Add same file system functionality
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
2020-01-01 11:54:01 +01:00
sharkdp 0f27485faf Quit immediately if the channel::send call failed 2020-01-01 11:21:52 +01:00
sharkdp 762f551ff4 Update --help text 2019-12-23 16:07:38 +01:00
Rafał Hajdacki fb205f5057 Allow changing current working directory of fd 2019-12-23 15:42:33 +01:00
EasiestSoft 32fdbb1eae Fixed typos, occurence to occurrence, seach to search 2019-12-19 21:52:43 +01:00
evitalis 19e5d6e36e Remove OpenBSD install instructions 2019-11-25 07:29:31 +01:00
sharkdp 0895027ed6 Add 'glob' syntax link as well 2019-11-25 00:14:26 +01:00
Deepansh c60cf9c1a8 Update man page 2019-11-25 00:14:26 +01:00
sharkdp c14a004367 Switch off nightly build 2019-10-22 22:18:31 +02:00
Deepansh a6ed0fc5ef Fix CI error
Fixes sharkdp/fd#496
2019-10-09 23:09:21 +02:00
Deepansh Sood 266499800b Fix idempotent flags
Add 'overrides_with' to format flags.
Resolves sharkdp/fd#488
2019-10-09 23:09:21 +02:00
David Peter 9491670974 Add sponsor button as an experiment :-) 2019-10-07 19:45:12 +02:00
sharkdp d48aeda6b2 Apply clippy suggestions 2019-09-23 20:23:11 +02:00
Nathan Henrie 59c27baf0f Expand help for -u, add to manpage 2019-09-17 22:21:37 +02:00
Nathan Henrie 33f385692d Add -u alias to long --help only
Fixed sharkdp/fd#92, specifically https://github.com/sharkdp/fd/issues/92#issuecomment-522756754
2019-09-17 22:21:37 +02:00
sharkdp b027b2c322 Update Cargo.lock 2019-09-15 19:29:15 +02:00
sharkdp 9350c8544d Clean up cfg line 2019-09-15 18:58:05 +02:00
sharkdp f55033818d Disable crate in Windows + musl builds 2019-09-15 18:58:05 +02:00
sharkdp 1ab4e87dda Disable jemalloc for musl builds 2019-09-15 18:58:05 +02:00
sharkdp 4e20803e7d Disable jemallocator on Windows 2019-09-15 18:58:05 +02:00
sharkdp 5a154866e3 Use jemalloc
Benchmark #1: ./fd-sys-alloc '[0-9]\.jpg$' /home/shark
  Time (mean ± σ):     246.8 ms ±   3.4 ms    [User: 960.1 ms, System: 810.0 ms]
  Range (min … max):   244.1 ms … 257.1 ms    12 runs

Benchmark #2: ./fd-jemalloc '[0-9]\.jpg$' /home/shark
  Time (mean ± σ):     201.0 ms ±   3.0 ms    [User: 833.9 ms, System: 666.9 ms]
  Range (min … max):   196.1 ms … 206.9 ms    14 runs

Summary
  './fd-jemalloc '[0-9]\.jpg$' /home/shark' ran
    1.23 ± 0.03 times faster than './fd-sys-alloc '[0-9]\.jpg$' /home/shark'
2019-09-15 18:58:05 +02:00
sharkdp ac3e0e18e4 Update lscolors for compatible ansi_term versions 2019-09-15 17:30:13 +02:00
sharkdp 9cc0c8ed57 Fix build script after update 2019-09-15 17:27:12 +02:00
sharkdp a991ed4488 Update dependencies 2019-09-15 17:26:19 +02:00
sharkdp fe79b8ce0a Update man page 2019-09-15 17:10:31 +02:00
sharkdp 25a728529d Bump version 2019-09-15 17:06:30 +02:00
sharkdp 1056220421 Update USAGE section 2019-09-15 17:05:34 +02:00
sharkdp 08fcd7ce59 Make --changed-within/before work for directories
closes #470
2019-09-15 17:03:23 +02:00
sharkdp 50fca2dca2 Disable full-path glob test on Windows 2019-09-15 16:47:38 +02:00
sharkdp 588888112a Adapt full-path glob test for Windows 2019-09-15 16:47:38 +02:00
sharkdp eac20a8132 Add --regex option to override --glob 2019-09-15 16:47:38 +02:00
sharkdp d5da615c17 Implement glob-based searches
closes #284
2019-09-15 16:47:38 +02:00
sharkdp 641594c2c6 Use regex::bytes::* instead of regex::* 2019-09-15 16:47:38 +02:00
sharkdp 2545aaabd2 Exit immediately when Ctrl-C has been pressed twice 2019-09-15 13:06:03 +02:00
David Peter 3599a30ee2 Support FILE_ATTRIBUTE_HIDDEN on Windows (#478) 2019-09-15 12:41:04 +02:00
sharkdp f14b854bc1 Use existing Cow pointer 2019-09-15 10:57:27 +02:00
sharkdp 8f86a06c1a Extend help text 2019-09-15 10:57:27 +02:00
Nathan Moreau 761c445263 Add a non regression test. 2019-09-15 10:57:27 +02:00
Nathan Moreau 588e344d5b Remove type annotation. 2019-09-15 10:57:27 +02:00
Nathan Moreau e3af9b0307 Factor into a helper function; adapt to print_entry_uncolorized. 2019-09-15 10:57:27 +02:00
Nathan Moreau 29bf9d731d Handle any string replacement. 2019-09-15 10:57:27 +02:00
Nathan Moreau 3857fa8f62 Amend clap configuration for path-separator. 2019-09-15 10:57:27 +02:00
Nathan Moreau 24e108e1ad Add path-separator option.
Example usage: `fd.exe --path-separator /` on windows.
2019-09-15 10:57:27 +02:00
sharkdp 1d16cd855e Fix warnings 2019-09-15 10:48:29 +02:00
sharkdp a0505bd4df Expose exit status from --exec-batch <cmd>
closes #333
2019-09-13 23:05:35 +02:00
David Peter 630749f706 Clarify statement about number of threads for parallell execution 2019-06-17 19:25:16 +02:00
Jason Heeris 1daa454615 Added detail on parallel execution job pool to man page and README. 2019-06-17 19:21:47 +02:00
Jason Heeris 040c57e007 Added gcc_prefix to make_deb() function. 2019-06-17 19:19:33 +02:00
Jason Heeris 1ce2add943 Added armhf deb target. 2019-06-17 19:19:33 +02:00
Jason Heeris 418233193a Added armhf build to CI. 2019-06-17 19:19:33 +02:00
Chloe Kudryavtsev 0b04bd19df Add Alpine Linux installation instructions
Resolves #451
2019-06-11 07:38:55 +02:00
David Peter ac2dae0427 Update Ubuntu install instructions 2019-05-31 21:26:00 +02:00
sharkdp 53afcd8fc3 Add a section about "removing files"
see #387
2019-05-31 14:30:54 +02:00
Pablo Varela d266fa3010 Remove npm on macOS 2019-05-10 11:43:57 -05:00
Pablo Varela e7d0a91986 ocd 2019-05-10 11:43:57 -05:00
Pablo Varela 801816ee6c Add instructions for npm 2019-05-10 11:43:57 -05:00
Tavian Barnes 5cbd8405ec Check the pattern before anything else, since it doesn't require metadata
This should partially address #432 by decreasing the number of stat() calls:

    $ strace -c -f ./fd-before '\.h$' /usr -j1 -S +1k >/dev/null
    % time     seconds  usecs/call     calls    errors syscall
    ------ ----------- ----------- --------- --------- ----------------
     15.71    8.831948           7   1192279     46059 stat
    $ strace -c -f ./fd-after '\.h$' /usr -j1 -S +1k >/dev/null
    % time     seconds  usecs/call     calls    errors syscall
    ------ ----------- ----------- --------- --------- ----------------
      7.92    1.972474          10    183907     46046 stat

Though it's not as few as possible:

    $ strace -c -f find /usr -iname '*.h' -size +1k >/dev/null
    % time     seconds  usecs/call     calls    errors syscall
    ------ ----------- ----------- --------- --------- ----------------
     19.01    0.946500           5    161649           newfstatat
    $ strace -c -f bfs /usr -iname '*.h' -size +1k >/dev/null
    % time     seconds  usecs/call     calls    errors syscall
    ------ ----------- ----------- --------- --------- ----------------
     13.73    0.406565           5     69005           statx

Performance is much better when metadata is required:

    $ hyperfine ./fd-{before,after}" '\.h$' /usr -j1 -S +1k"
    Benchmark #1: ./fd-before '\.h$' /usr -j1 -S +1k
      Time (mean ± σ):      4.623 s ±  0.154 s    [User: 1.465 s, System: 3.354 s]
      Range (min … max):    4.327 s …  4.815 s    10 runs

    Benchmark #2: ./fd-after '\.h$' /usr -j1 -S +1k
      Time (mean ± σ):      2.650 s ±  0.058 s    [User: 1.258 s, System: 1.592 s]
      Range (min … max):    2.568 s …  2.723 s    10 runs

    Summary
      './fd-after '\.h$' /usr -j1 -S +1k' ran
        1.74 ± 0.07 times faster than './fd-before '\.h$' /usr -j1 -S +1k'

While remaining the same when it's not:

    $ hyperfine ./fd-{before,after}" '\.h$' /usr -j1"
    Benchmark #1: ./fd-before '\.h$' /usr -j1
      Time (mean ± σ):      2.382 s ±  0.038 s    [User: 1.221 s, System: 1.286 s]
      Range (min … max):    2.325 s …  2.433 s    10 runs

    Benchmark #2: ./fd-after '\.h$' /usr -j1
      Time (mean ± σ):      2.362 s ±  0.034 s    [User: 1.193 s, System: 1.294 s]
      Range (min … max):    2.307 s …  2.422 s    10 runs

    Summary
      './fd-after '\.h$' /usr -j1' ran
        1.01 ± 0.02 times faster than './fd-before '\.h$' /usr -j1'
2019-05-08 07:28:47 -05:00
Laurent Arnoud 35945c4a62 Use dual license on Debian
cf https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2019-03-17 18:59:16 +01:00
Laurent Arnoud 97908beb97 Add copyright file for deb package
ref https://github.com/sharkdp/fd/issues/416
2019-03-17 18:59:16 +01:00
evitalis f15540e501 Add OpenBSD installation steps 2019-03-13 08:17:06 +01:00
Tim Holland 074cfad3d4 Remove deprecated trim_left(_matches)?
warning: use of deprecated item 'core::str::<impl str>::trim_left_matches': superseded by `trim_start_matches`
   --> src/main.rs:222:28
    |
222 |                 .map(|e| e.trim_left_matches('.'))
    |                            ^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(deprecated)] on by default
2019-03-02 08:15:12 +01:00
Tobias Kortkamp f3ec3d9cf0 Update FreeBSD install instructions
Installing fd does not require using portmaster (it will also build
fd from source).  IMHO this is pretty misleading.  Let's update the
FreeBSD install instructions to recommend using the binary package
in the official repository like on other systems.
2019-02-27 07:21:45 +01:00
Alex Leferry 2 46e865f1a2 Fix documentation to filter search by directory type 2019-02-19 07:21:02 +01:00
sharkdp 7f58e8f706 Update man page 2019-02-13 20:04:37 +01:00
sharkdp f1ab443dd0 Update USAGE in README 2019-02-13 19:58:27 +01:00
sharkdp acd4910f2c Update dependencies 2019-02-13 19:53:48 +01:00
sharkdp c83bcfbdfc Bump version number 2019-02-13 19:50:50 +01:00
Alexandru Macovei c2b46f247f avoid cloning command, in the wake of 9d26b74 2019-01-30 20:42:43 +01:00
Alexandru Macovei fe53af064b fix most clippy lints 2019-01-26 16:15:48 +01:00
Alexandru Macovei 6aa87f3423 save one indent level in error handling for add_ignore 2019-01-26 16:15:48 +01:00
Alexandru Macovei 74e593c43c inline value used only once 2019-01-26 16:15:48 +01:00
Alexandru Macovei df4227c614 Uniform names for config and wants_to_quit. Pass Arc's by ref. 2019-01-26 16:15:48 +01:00
Alexandru Macovei 5ade72a5e1 split spawn_receiver(..) and spawn_senders(..) from scan(..).
This is just a split commit, refraining from renaming too much.

The drop(tx) call is no longer necessary, as the first sender
is dropped at the end of spawn_senders(..)
2019-01-26 16:15:48 +01:00
Alexandru Macovei d8bd5f9d51 macronize repetitive tests in exec/input 2019-01-26 16:15:48 +01:00
sharkdp 85f9db0565 Add troubleshooting section, closes #386 2019-01-09 23:06:54 +01:00
sharkdp 2672d84160 Add section about catch-all patterns, closes #385 2019-01-09 23:06:54 +01:00
sharkdp 8cfdcf43f6 Lock stdout only once 2019-01-09 08:20:20 +01:00
sharkdp 8c197d2866 Update to new lscolors version 2019-01-08 21:28:43 +01:00
Alexandru Macovei 051ff5987a [2018 edition] remove all extern crate lines from sources 2019-01-07 12:52:30 +01:00
Alexandru Macovei 630f173724 [2018 edition] enable 2018 edition 2019-01-07 12:52:30 +01:00
Alexandru Macovei 64e6ea9fe9 [2018 edition] run cargo fix edition and edition-idioms 2019-01-07 12:52:30 +01:00
sharkdp 33feb511f0 Formatting 2019-01-01 17:40:53 +01:00
sharkdp 985fab16bb Add note about short and long help text, closes #286 2019-01-01 17:40:30 +01:00
sharkdp a17a3fe5ef Add comment about hidden files/directories, see #377 2019-01-01 16:31:06 +01:00
sharkdp 04debe5c4e Adapt README 2019-01-01 16:23:22 +01:00
Sylvestre Ledru ec99e5d34c Update info about debian & ubuntu 2019-01-01 16:20:04 +01:00
sharkdp 047f1be792 Update dependencies 2018-12-14 23:20:18 +01:00
sharkdp ecd5ec6387 Bump lscolors version 2018-12-14 23:20:18 +01:00
sharkdp 3c87952c47 Bump minimum required Rust version 2018-12-14 23:20:18 +01:00
sharkdp 4b5efa3438 Use lscolors crate
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 #368
closes #363
2018-12-14 23:20:18 +01:00
sharkdp afcdaf2e3d Move snapcraft file 2018-11-29 21:21:00 +01:00
Alan Pope 1abdf47731 Remove statefile 2018-11-29 21:20:18 +01:00
Alan Pope 92b5c9f71e Add support for building a snap of fd 2018-11-29 21:20:18 +01:00
sharkdp f09f038bd2 Add .gitattributes files 2018-11-12 21:26:46 +01:00
kimsnj 6b40a075cd exec-batch: fix a panic with -X "echo {}" and pass stdio to child cmd 2018-11-12 21:11:40 +01:00
kimsnj 45d1b15cff Add support for batch execution of command 2018-11-12 21:11:40 +01:00
kimsnj 32ec7afc3a Add test with multiple tokens in an argument 2018-11-10 10:29:35 +01:00
teresy 34b8c0df73 refactor: use shorthand fields 2018-11-08 11:48:12 +01:00
Duncan Finney 831f517f5a Add ARM static binary #320 (arm-unknown-linux-musleabihf) 2018-11-04 11:47:44 +01:00
sharkdp f064ee5509 Properly use .ignore files, see #156 2018-10-27 18:11:50 +02:00
sharkdp 26c2371835 Bump version 2018-10-27 17:09:00 +02:00
sharkdp 8832e471bc Update man page 2018-10-27 17:07:09 +02:00
sharkdp daf5191aac Add note about .ignore files 2018-10-27 16:44:34 +02:00
sharkdp c0c38872c4 Update usage 2018-10-27 16:37:41 +02:00
sharkdp 81a27fa9bd Unify error messages, closes #342 2018-10-27 16:30:29 +02:00
sharkdp 6ff58abb6c Re-enable .ignore files, closes #156 2018-10-27 15:42:02 +02:00
sharkdp 974802e817 Hide a few options from short '-h' text 2018-10-27 15:38:26 +02:00
sharkdp deea31cbbc Add aliases, change help text 2018-10-27 15:34:10 +02:00
Josh Leeb-du Toit caad43fe6c Use oss_vec fn in internal/mod.rs tests 2018-10-24 16:31:16 +02:00
Park Juhyung 095bad550f Print errors when --verbose is set 2018-10-23 21:50:25 +02:00
Park Juhyung f7a96bd980 Fix typo at max-buffer-time's help message
"tothe" -> "to the"
2018-10-23 07:03:21 +02:00
Casey Primozic cdf737bf5c Add search-path option
* 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
2018-10-22 19:26:36 +02:00
yobrave e2bb932f87 Doc: add chinese readme link (#347) 2018-10-19 22:05:15 +02:00
David Peter 437bd1188e Remove shell prompt 2018-10-14 19:27:03 +02:00
David Peter dae09ecf6d Add recommendation for "alias fd=fdfind" 2018-10-14 19:26:22 +02:00
Sylvestre Ledru d81cf34771 fd is now officially in Debian (#345)
* fd is now officially in Debian
2018-10-14 19:21:16 +02:00
Benjamin Fox b98f0783ff Enable link-time optimization in release builds
This gives a significant improvement to runtime performance, at the cost of somewhat worse compile times.
2018-10-14 18:47:25 +02:00
Josh Leeb-du Toit 8543ca645d Split internals.rs into module and multiple files
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.
2018-10-12 19:14:19 +02:00
Josh Leeb-du Toit 984f04f142 Add print_error macros to replace functions
This patch replaces the `print_error` and `print_error_and_exit`
functions with equivalent macros.
2018-10-12 07:31:21 +02:00
Karim SENHAJI abe8aa55c0 clean-up first implementation of modification date filter 2018-10-10 19:52:37 +02:00
Karim SENHAJI 54c117d72f Add support for --changed-before and --changed-with for modification time based search 2018-10-10 19:52:37 +02:00
Josh Leeb-du Toit 8691ab4bed Minor changes to improve readability
This patch makes minor changes to make the code a little easier to
understand. For example, using the `?` operator in some fns that return
an `Option` type.
2018-10-04 09:44:09 +02:00
Josh Leeb-du Toit cb1cfa108b ErrorCode enum variants to be more descriptive 2018-10-03 16:06:18 +02:00
Josh Leeb-du Toit 8bdd8f8e8f Move exit code consts into enum
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.
2018-10-03 16:06:18 +02:00
psinghal20 f9c4e8d399 refactor: loosen strict handling of missing --ignore-file 2018-10-03 13:11:51 +02:00
Josh Leeb-du Toit adc467b2b2 Add exec tests and cfg(test) compiler guards
Some tests throughout the codebase were just functions marked with the
`#[test]` macro. It is convention to have these test functions in a
`test` module with a compiler guard `cfg(test)`. This PR updates the
tests that aren't already setup like this to be in the `test` module.

Additionally, this PR also adds tests to the `exec` module to check the
remaining `Token` enum variations.
2018-10-03 13:04:22 +02:00
sharkdp 56b6389dac --exec: Do not exit on errors 2018-10-01 22:00:23 +02:00
sharkdp 046b0574dc Rename error => print_error_and_exit and introduce print_error 2018-10-01 22:00:23 +02:00
psinghal20 6407dc4eb4 chore: format code via rustfmt 2018-10-01 22:00:23 +02:00
psinghal20 2ebef2d46f feat: enable display of error messages 2018-10-01 22:00:23 +02:00
sharkdp 27caa33729 cargo fmt 2018-09-27 23:01:38 +02:00
sharkdp 53226f82eb Upgrade minimum reqiured version of Rust to 1.29
This upgrades the minimum required version of Rust to 1.29 in order to
fix #288.

See also:
- Rust compiler bug ticket: rust-lang/rust#50619
- Rust compiler PR with the fix: rust-lang/rust#50630

closes #288
2018-09-18 21:04:09 +02:00
sharkdp 8fb25f15c9 Just reference --max-depth in --maxdepth help 2018-09-13 22:33:18 +02:00
Mahmoud Al-Qudsi d375b5e1f5 Add --maxdepth as hidden alias for --max-depth
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.
2018-09-13 22:33:18 +02:00
sharkdp 2465cd1399 Update man page 2018-08-19 18:50:47 +02:00
sharkdp 1c7e647f61 Bump version 2018-08-19 18:50:41 +02:00
sharkdp 67e76b8b5b Update USAGE 2018-08-19 18:50:35 +02:00
sharkdp aa70c5a446 Add --type empty
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
2018-08-19 17:05:04 +02:00
sharkdp 50a2bab5cd Use short-circuiting for --type searches
Reverses the order of boolean checks for `--type` searches,
making them about 10% to 50% faster(!).
2018-08-19 16:27:23 +02:00
sharkdp 641976cf7a Remove duplicated lstat syscall
Removes a unnecessary `lstat` syscall by calling `.metadata()` only
once. This makes `--type executable` searches about 15% faster.
2018-08-19 16:23:06 +02:00
sharkdp 6fb5004b85 Enable ARM cross-compilation
closes #244
2018-08-19 15:30:59 +02:00
kpcyrd e4f61bc795 Remove unused windows dependencies 2018-08-18 16:40:08 +02:00
sharkdp c428f52209 Run cargo fmt 2018-08-03 21:20:48 +02:00
sharkdp 59c9901cde Update dependencies, fix #313 2018-08-03 21:20:48 +02:00
Alexandru Macovei 4dee8b7940 fix build for rust 1.20.0 2018-07-02 19:55:03 +02:00
Alexandru Macovei 9a45947234 simplify SizeFilter as enum with value instead of struct
Also move the touched cfg(test) code into cfg(test) module and trim test names
2018-07-02 19:55:03 +02:00
sharkdp c1ef68662c Update for new rustfmt 2018-05-14 21:00:00 +02:00
Josh Sleeper 9628d7fdcb chore(crate-updates): updated all crates to latest versions 2018-05-05 08:56:04 +02:00
David Peter cb47be6497 Fedora is now in the official repositories 2018-05-02 20:54:08 +02:00
sharkdp a3200204dc Simplifications to --size tests 2018-04-29 22:26:10 +02:00
Jonathan e2b2701965 Add helper method to create sized files, use meaningful names and add kibi and kilo tests. 2018-04-29 21:56:31 +02:00
Jonathan 409cf0c7a1 Remove use (which broke the build) 2018-04-29 21:56:31 +02:00
Jonathan f01685c63f Add tests for SizeFilter (--size) fixes sharkdp/fd#289 2018-04-29 21:56:31 +02:00
David Peter 060d14b5dc Update README.md 2018-04-26 19:53:04 +02:00
Rainer Müller fe922688b3 README: Add install instructions for MacPorts 2018-04-26 19:51:04 +02:00
sharkdp 4172ed03f0 Do not include non-files when using --size 2018-04-25 23:08:05 +02:00
Steve Pentland 0bbc7f5219 Update regex and match, update comments 2018-04-25 08:14:12 +02:00
Steve Pentland ace3f512d3 Make compatible with min rust version 2018-04-25 08:14:12 +02:00
Steve Pentland 2f3b472dfd Changes from review 2018-04-25 08:14:12 +02:00
Steve Pentland 0207c1371e Initial impl of size constraints.
This adds find-style size constraints with + or - indicating greater
or less than, a numerical size, and a unit
2018-04-25 08:14:12 +02:00
David Peter fea85dbfb3 Re-enable nightly 2018-04-21 12:54:00 +02:00
sharkdp b5e5b132c8 Temporarily disable nightly, rustc-ap-rustc_errors is broken 2018-04-20 08:28:18 +02:00
sharkdp 6a9f16e159 Run latest version of rustfmt 2018-04-13 23:13:22 +02:00
sharkdp f02b3cba6a Fix typos 2018-04-13 23:13:22 +02:00
Chen Bin 666f90db87 Re-org fzf part. Doc on using fd with Emacs 2018-04-13 23:13:22 +02:00
Avindra Goolcharan 2a1ee0b17d README: openSUSE package available
add software.opensuse.org link and `zypper in fd`
2018-04-01 17:25:23 +02:00
sharkdp 388b90e624 Update USAGE and man page 2018-03-26 10:25:33 +02:00
sharkdp 011e09840a Bump version number 2018-03-26 10:16:18 +02:00
sharkdp 37483036e0 Implement --ignore-file 2018-03-26 08:28:22 +02:00
David Peter 8c1b037279 Normalize absolute paths, fixes #268 (#270)
* Normalize absolute paths, fixes #268
* Split unit tests into several tests
2018-03-25 23:47:58 +02:00
sharkdp f9a32583a5 Move is_executable to fshelper module 2018-03-25 19:48:09 +02:00
sharkdp 9d840dd485 Separate unit tests 2018-03-25 19:00:46 +02:00
sharkdp 4f6c43a6dc Unit test for --type x 2018-03-25 18:37:50 +02:00
sharkdp 2cf8e7b8a5 Move is_executable to internal module 2018-03-25 18:37:50 +02:00
Pramod Bisht 67f6fdf6a7 Code formating 2018-03-25 16:53:12 +02:00
Pramod Bisht 8ce127e443 changed executable=> executable_only 2018-03-25 16:53:12 +02:00
Pramod Bisht b1e48efc4a Addresses #246
Some implementation to search by filetype `executables`
2018-03-25 16:53:12 +02:00
joachimschmidt557 ab3ded8d27 Update README.md 2018-03-16 06:11:32 +01:00
sharkdp 5397787824 Skip fifos, sockets, .. when using --type f/d/l 2018-03-15 21:38:52 +01:00
sharkdp ffd49c60bd Error if user supplied path instead of pattern 2018-03-15 07:53:00 +01:00
sharkdp 89a8f5573d Formatting change 2018-03-15 07:53:00 +01:00
sharkdp d49b0aa977 Fix small mistake in README 2018-03-14 22:40:49 +01:00
KmBKeef ddddc3f1db fd on Fedora copr (#255)
created fd rpm and added it to Fedora copr
2018-03-14 21:12:16 +01:00
David Peter 87d0ccd4c0 Documentation for -E and .fdignore, see #156 2018-03-13 22:54:08 +01:00
sharkdp c654159bf2 Update to ansi_term 0.11 2018-03-12 23:19:20 +01:00
Josh Stone 588b0dc7c9 Update to regex-syntax 0.5
The new regex 0.2.7 has updated to regex-syntax 0.5, so it seems prudent
to update fd's dependency too, if only to avoid duplication.
2018-03-12 22:11:00 +01:00
sharkdp 88fb9d73d1 Run updated version of rustfmt 2018-03-12 17:46:13 +01:00
sharkdp 3386b854b0 Run invalid-utf8 on Linux only 2018-02-26 08:20:31 +01:00
sharkdp 47d95284aa Skip invalid utf8 filenames, closes #250 2018-02-26 08:20:31 +01:00
sharkdp 631931b431 Only construct entry_path if needed 2018-02-25 18:17:11 +01:00
sharkdp 40d811c7be Rewrite of file-type filtering leading to 5% speed-up 2018-02-25 18:17:11 +01:00
sharkdp e5ee5eb7b3 Minor speedup for strip_prefix 2018-02-25 10:25:59 +01:00
David Peter 82eeeda504 Update README.md 2018-02-24 12:07:24 +01:00
Chawye Hsu f16552f29c Add a installation method for Windows 2018-02-24 12:06:46 +01:00
sharkdp e30bc16780 Fix symlink filetype shortcut in man page 2018-02-21 22:58:22 +01:00
sharkdp b4be1f161c Add support for .fdignore files 2018-02-21 22:55:26 +01:00
sharkdp 8805bd32e2 Update dependencies 2018-02-21 22:55:26 +01:00
Pramod Bisht 7a3994decb Changes as per the instruction of cargo fmt -- --write-mode=diff 2018-02-19 21:17:11 +01:00
Pramod Bisht 7e8c2248d0 Fixes: #234
Giving suggestion to use `--fixed-strings` in case user passes invalid metacharacters as a regex.
2018-02-19 21:17:11 +01:00
Georgy Yakovlev ad8256c217 README.md: gentoo now has fd ebuild, document it 2018-02-19 08:38:14 +01:00
David Peter 1bf193af60 Update links to license files 2018-02-13 20:41:04 +01:00
David Peter 1c1be76f35 Update README.md 2018-02-13 08:10:16 +01:00
David Peter 267598fba5 Arch Linux package was renamed to 'fd' 2018-02-11 11:41:54 +01:00
sharkdp 11b3e96d2d Install fakeroot when deploying 2018-02-10 17:23:26 +01:00
sharkdp a6086abe7f Updates for v6.3.0 2018-02-10 16:46:42 +01:00
David Peter 7f65e7a0d6 Update benchmark results 2018-02-10 16:43:36 +01:00
sharkdp 814d37030e Implement -F/--fixed-strings/--literal 2018-02-10 15:55:06 +01:00
Lewis Belcher 089c183d30 Update README.md
The suggested use of `--ignore` no longer exists (renamed to `--no-ignore`)
2018-02-10 14:19:54 +01:00
Martin Larralde 370d9f081f Use RegexSet instead of hand-written parser 2018-02-10 14:18:37 +01:00
Martin Larralde 86fe9977e8 Implement multiple suffixes extension support with tests (#214) 2018-02-10 14:18:37 +01:00
Martin Larralde b1bb60ebb9 Install rustfmt-nightly in debug mode in Travis (#231) 2018-02-07 19:50:10 +01:00
Steve Pentland b4d39270d6 Allow -exec to work as --exec (#226)
* Replace usage of `-exec` by `--exec`, except when it is used as a value that is given to `--exec/-exec/-x`.
* Limit usage of --exec option to single instance.
2018-01-29 20:32:46 +01:00
sharkdp 6d83eea32b Small screencast updates 2018-01-28 15:44:07 +01:00
Mario Nebl 26beaf97a6 Update screencast 2018-01-28 12:59:27 +01:00
Mario Nebl 33d37d7623 Avoid glitches on new prompt lines 2018-01-28 12:59:27 +01:00
Mario Nebl dce004afef Use updated screencast 2018-01-28 12:59:27 +01:00
Mario Nebl c1941cc7ed Change to working char to signify carriage returns 2018-01-28 12:59:27 +01:00
Mario Nebl 0a1c65b9ce Delay command with output before them 2018-01-28 12:59:27 +01:00
Mario Nebl 4fb9d84ffc Use new screencast
* Might not require rawgit as per https://github.com/marionebl/svg-term-cli/issues/5#issuecomment-360037548
2018-01-28 12:59:27 +01:00
Mario Nebl 2a84eb5cea Update screencast 2018-01-28 12:59:27 +01:00
Mario Nebl 6dd59b33b1 Document svg-terminal command 2018-01-28 12:59:27 +01:00
Mario Nebl 4fea5f3a3c Ensure -h output can be read at end of cast 2018-01-28 12:59:27 +01:00
Mario Nebl b269f4902e Demonstrate -e and --exec flags 2018-01-28 12:59:27 +01:00
Mario Nebl 33791d8400 Use ▶ prompt 2018-01-28 12:59:27 +01:00
Mario Nebl 4e737b4b44 Use upstream src 2018-01-28 12:59:27 +01:00
Mario Nebl c985ba2e6f Use local svg demo 2018-01-28 12:59:27 +01:00
Mario Nebl 658a97a94a Add svg screencast 2018-01-28 12:59:27 +01:00
Dock O'Neal bc2b7a33ae Fixing exec hang by disabling ctrl-c handling for exec 2018-01-25 07:47:04 +01:00
Vinaya 1045930dd9 Fix typos (#218)
This fixes few typos: "distributions", "want to" instead of "want so".
2018-01-10 13:02:25 +01:00
David Peter cc36543da2 Add GA
I'm curious :-)
2018-01-09 17:41:02 +01:00
sharkdp 050fa9c3b1 Fix file owner in deb package, closes #213
Also, fix a few lintian warnings / errors.
2018-01-04 19:48:59 +01:00
sharkdp 6be33fbf33 Update dependencies 2018-01-03 10:40:28 +01:00
sharkdp 61a065dd92 Update version information 2018-01-03 10:40:28 +01:00
sharkdp 941caeb053 Update documentation 2018-01-03 10:40:28 +01:00
David Peter 32a34cf8c9 Introduce maximum output buffer size (#212)
Closes #191
2018-01-03 10:40:08 +01:00
sharkdp 39fb41f05a Move exit codes to 'internal' module 2018-01-03 10:00:22 +01:00
Dock 26ad7da347 Using wants_to_quit to exit the sender as well as the reciever (#211)
Closes #210
2018-01-03 09:26:11 +01:00
sharkdp c5b920b913 Fix shell completion directories for Ubuntu 2018-01-03 09:10:33 +01:00
sharkdp 37613d6989 Fix rustftm check 2018-01-02 23:05:16 +01:00
David Peter b4ae0dca7e Add instructions on how to use fd with fzf 2018-01-02 22:26:38 +01:00
sharkdp 8dde7c3365 Re-enable help-text wrapping 2018-01-01 16:01:29 +01:00
sharkdp a5f5ad6254 Re-enable code style check 2018-01-01 16:00:32 +01:00
sharkdp aeb3722b69 Update installation instructions, see #174 2018-01-01 15:27:05 +01:00
Thejaswi Kadur faf934da4b Added support for filtering by multiple filetypes and extensions (#205)
Closes #177 
Closes #199
2018-01-01 12:09:33 +01:00
Dock 4d66c84109 Correct exit codes (#202)
* Changed exit code on ctrl-c to 130 to match specification
* Changed exit code when stdout errors. 1 for general error.
2017-12-18 06:53:34 -08:00
Thayne McCombs 2bc72a5eca Fix bash_completion path in deb. 2017-12-14 19:26:24 -08:00
sharkdp 8702133ee8 Temporarily disable the cargo fmt check 2017-12-13 19:23:38 -08:00
sharkdp 9192bc153f Fix path of bash completion 2017-12-09 23:01:32 -08:00
sharkdp b2797c0c45 Bump minimum rust version to 1.20 2017-12-09 22:14:53 -08:00
sharkdp aaf9e024d5 Updates for 6.1.0 2017-12-09 21:40:13 -08:00
Matthias Reitinger 5784823aca Unify execute_command across platforms 2017-12-09 21:10:48 -08:00
Dock 51aea57a6a Add multiple path support (#182)
* Adding support for multiple paths. (panic)

- Started adding multiple file support
- fd panics with multiple files right now

* Moved the ctrlc handler to main.

- Moved the ctrlc handler to main so we can search multiple files

* Tests now allow custom directory setup

- TestEnv::new() now takes two arguments, the directories to create and
the files to create inside those directories.

* rust-fmt changes

* rust-fmt changes

* Moving code around, no need to do everything in one big loop

- PathDisplay was never actually used for anything, removed it during refactor of main
- Removed redundant logic for absolute paths
- Moved code placed needlessly inside a loop in the last commit outside of that loop.

* Moving code around, no need to do everything in one big loop

- PathDisplay was never actually used for anything, removed it during refactor of main
- Removed redundant logic for absolute paths
- Moved code placed needlessly inside a loop in the last commit outside of that loop.

* Removed commented code in testenv

* Refactored walk::scan to accept the path buffer vector. Using the ParallelWalker allows for multithreaded searching of multiple directories

* Moved ctrlc handler back into walker, it is only called once from main now.

* Moved the colored output check back to it's original place

* Removing shell-escape, not sure how it got added...

* Added test for `fd 'a.foo' test1` to show that a.foo is only found in the test1 and not the test2 direcotry

* Removing side effect from walk::scan, `dir_vec` is no longer a mutable reference and an iterator is being used instead.

* Running rustfmt to format code correctly
2017-12-06 14:52:23 -08:00
Thayne McCombs 8914b43845 Fix deb build 2017-12-05 12:11:01 -08:00
Thayne McCombs 59ea560d37 Create deb file as part of CI build. WIP 2017-12-05 12:11:01 -08:00
Ubuntu c165ff0546 Refactorying main.rs : remove unused variable (empty_pattern) 2017-12-03 12:21:09 +01:00
doxterpepper e2b8a3cce2 The -i flag allows a package to be installed without updating. It seems cargo-update is checking only for installed packages to be updated. Since rustfmt is not installed initially in the travis build then it does not need updating and so nothing happens. The -i flag fixes that by telling cargo-update to install the package. 2017-12-03 11:22:52 +01:00
ptzz 9bd1d12c00 Add --no-ignore-vcs option
When passed, .gitignore files will not be respected.
2017-11-22 23:18:22 +01:00
Dock c0bfc65d88 Handle terminal signals (#128)
fixes #87
2017-11-22 23:05:09 +01:00
maxice8 44ee5a0b85 Add instructions on how to install under Void Linux 2017-11-18 11:15:31 +01:00
sharkdp 941a1e3d21 Update Cargo.lock 2017-11-16 08:26:40 +01:00
David Peter 0999f8e328 Updated installation instructions 2017-11-16 08:19:20 +01:00
sharkdp 9be32fa6a7 Bump version number 2017-11-15 23:39:55 +01:00
sharkdp 5ed7514096 Update error message if command could not be found 2017-11-15 23:24:11 +01:00
Matthias Reitinger 3c5d8a1e86 Fix typos 2017-11-15 23:18:36 +01:00
Matthias Reitinger ccdbc76f5a Fix execute_command on Unix 2017-11-15 23:18:36 +01:00
Matthias Reitinger 355a171557 Fix manpage formatting 2017-11-15 23:18:36 +01:00
Matthias Reitinger 5f4a1203b4 Update documentation for --exec syntax change 2017-11-15 23:18:36 +01:00
Matthias Reitinger 0f82fe7ec0 Rename TokenizedCommand to CommandTemplate 2017-11-15 23:18:36 +01:00
Matthias Reitinger c18caaa6f6 Remove CommandTicket to avoid Vec allocation 2017-11-15 23:18:36 +01:00
Matthias Reitinger bc88b8f80e Fix exec tests 2017-11-15 23:18:36 +01:00
Matthias Reitinger 18709b1ede Remove shell with --exec 2017-11-15 23:18:36 +01:00
Andrey Cherkashin 1a6c92c475 Add instructions on how to install under FreeBSD
As of this morning 5.0.0 is in ports tree.
2017-11-15 21:54:34 +01:00
Andrey Cherkashin 3104729f29 Create shell completions OUT_DIR 2017-11-15 19:54:26 +01:00
Adit Cahya Ramadhan 673392045f Check minimal rustc version on the build process 2017-11-13 19:27:51 +01:00
sharkdp 26f71dd21a Remove superfluous path.replace
See #153
2017-11-11 08:58:55 +01:00
sharkdp c022528f54 Bump version for crates.io
[ci skip]
2017-10-26 22:24:07 +02:00
David Peter 46db4a3860 Fix Windows module 2017-10-26 22:20:12 +02:00
sharkdp b3f1e1844d Move 'win' crate back into local module
This is necessary to publish on crates.io
2017-10-26 21:59:12 +02:00
sharkdp bba5c4f607 Fix some clippy warnings 2017-10-26 21:13:56 +02:00
J.W 614f576c47 Add TODOs and FIXMEs about Windows 2017-10-26 20:56:32 +02:00
J.W dc29ef70c4 Fix Input::remove_extension and Input::dirname 2017-10-26 20:56:32 +02:00
J.W d702d849ea Test --exec on Unix 2017-10-26 20:56:32 +02:00
J.W 6b232a82ee Fix --exec 2017-10-26 20:56:32 +02:00
J.W 87ba4e3bb0 Fix root directory for Windows 2017-10-26 20:56:32 +02:00
sharkdp 9d26b74c2a Workaround for the unsafe block.
See #147
2017-10-25 22:45:00 +02:00
sharkdp 7b8d9322ba README and man page updates. 2017-10-25 22:43:36 +02:00
sharkdp 5ad69fb2fb Add support for exclude-patterns
* Add `--exclude`/`-E` option.
* Support for multiple exclude patterns

Example:
``` bash
> fd --exclude 'tests/**/*.rs' mod
src/exec/mod.rs
src/fshelper/mod.rs
src/lscolors/mod.rs
```

Closes #89
2017-10-25 22:22:12 +02:00
sharkdp 19afb15a98 Fix --exec examples in README
[ci skip]
2017-10-25 21:44:13 +02:00
sharkdp f4ed2ba74d Man page updates
[skip ci]
2017-10-25 21:16:35 +02:00
J.W e38b7d7bff Fix --type: skip if file type is unknown 2017-10-25 18:29:40 +02:00
sharkdp 1ec204caa8 Add correct secret key for Travis 2017-10-25 18:28:27 +02:00
Adit Cahya Ramadhan dbf1ba8b82 Set up Travis to upload binary for every release
- Add deploy script
- Set deployment option on `.travis.yml`

fix #76
2017-10-25 18:27:13 +02:00
John L. Villalovos 4bf7ab67d0 Typo fix: Change 'descent' to 'descend'
The correct word is 'descend'

Change-Id: I6833bd28e84841799f3f060239a36876949d890e
2017-10-25 18:18:33 +02:00
sharkdp 7ecb623950 Updates for the parallel command execution part
[skip ci]
2017-10-22 21:59:03 +02:00
sharkdp 5863a5e706 Updates for the tutorial
[skip ci]
2017-10-22 21:59:03 +02:00
sharkdp d32fe0241e Updated tutorial with real-world examples
Initial work by @TitiAlone

Closes #73

[skip ci]
2017-10-22 21:59:03 +02:00
sharkdp e9cf8af911 Updates and preparations for v5.0 2017-10-22 12:10:51 +02:00
Adit Cahya Ramadhan 15a3ca0c80 Using cargo-update to update the rustfmt on travis 2017-10-22 10:38:20 +02:00
Antti Keränen 701b8f209b Relicense under MIT/Apache-2.0 2017-10-22 10:36:42 +02:00
J.W 570ea78d24 jakwings/fd@a44e677 -> subdirectory "win" 2017-10-21 00:33:49 +02:00
J.W ce73c086b6 Auto disable colored output for unsupported Windows shells 2017-10-21 00:33:49 +02:00
Michael Aaron Murphy 6a01faf6e1 Escape exec Inputs 2017-10-21 00:29:46 +02:00
Ben Morgan 200dfaa20a README: Arch Linux has package fd-rs in official repos 2017-10-21 00:23:15 +02:00
Jose Narvaez 6dc704a18e Removed unnecessary exclusion of Redox in cond-compilation and narrowed what we import from . 2017-10-20 12:59:36 +02:00
Jose Narvaez 715b07599b RedoxOS support. 2017-10-20 12:59:36 +02:00
Adit Cahya Ramadhan d2d2c31307 Only test x86_64-unknown-linux-gnu on beta and nightly
Reducing total CI time
2017-10-20 09:01:40 +02:00
Adit Cahya Ramadhan f7f5192139 Incorporate TARGET in the install and build step
- Tidying up the build matrix
  - All channels has TARGET env var
  - Build against this targets:
    - x86_64-unknown-linux-gnu
    - x86_64-unknown-linux-musl
    - i686-unknown-linux-gnu
    - i686-unknown-linux-musl
    - x86_64-apple-darwin
  - Code formating check has it's own item in the build matrix
- Prevent target re-add error from rustup
- Incorporate the TARGET env var in the `install` and `script` stage
2017-10-20 09:01:40 +02:00
Ivan Tham ddfa0873fb Shorten man page with some fixes
Maybe in the future we need to redirect `--help` to the man pages? Is there a way for cargo to install the man pages?
2017-10-19 20:10:34 +02:00
Ivan Tham b6c95a4800 Add fd.1 man page 2017-10-19 20:10:34 +02:00
J.W 8d85debc12 Refactor path handling (fixes #113)
* Fix path check
* Fix full path matching
* Allow more simple driver names in Windows tests
* Factor out special is_dir() check for "." and ".."
2017-10-18 20:04:34 +02:00
Florian Hofmair 37def9bb83 Allow overriding of OUT_DIR in build.rs (#124) 2017-10-17 08:11:42 +02:00
David Peter e0eab07881 Merge pull request #116 from mmstick/exec
Implement the --exec flag
2017-10-15 21:36:51 +02:00
Michael Aaron Murphy 16eed82ca1 Handle OS-specific path separators when manipulating paths 2017-10-15 11:20:55 -04:00
Michael Aaron Murphy 2a23905af5 Fix merge conflicts 2017-10-15 09:37:48 -04:00
J.W 54d9dde0d4 Use .canonicalize() to check paths & Reword comments 2017-10-15 15:01:24 +02:00
J.W e649c8fa79 Use a uniform output format for searching ../
closes #107, fixes #82 by the way
2017-10-15 15:01:24 +02:00
sharkdp fe5d8aa29e Disable rust-beta and nightly on AppVeyor 2017-10-15 12:46:06 +02:00
J.W ecfd5568cf AppVeyor: fix path of cache direcotry 2017-10-15 10:12:55 +02:00
Matt 08aa06a0ad Added another way of installation
Added option using Nix package manager
2017-10-15 10:12:02 +02:00
Michael Aaron Murphy ad1b4f3b2b Optimize grouping for *nix archs 2017-10-14 21:45:31 -04:00
Michael Aaron Murphy 1bc58b2fbb Group outputs from exec 2017-10-14 18:06:49 -04:00
Michael Aaron Murphy 718f723d31 Enable absolute paths w/ exec 2017-10-14 16:42:47 -04:00
Michael Aaron Murphy 884bd41cae Apply cargo fmt 2017-10-14 14:04:04 -04:00
Michael Aaron Murphy fb1cd3a322 Fix for older builds
Rust 1.19 will be a requirement, however.
2017-10-14 13:38:54 -04:00
sharkdp db5f2fc3ac Enable caching on appveyor 2017-10-14 18:55:26 +02:00
Michael Aaron Murphy 137fe2e697 Merge Conflicts 2017-10-14 12:35:16 -04:00
Michael Aaron Murphy 4a5a5faf4d Implement --exec feature
Closes #84
2017-10-14 12:24:17 -04:00
J.W f2632d5fce Dot "." also matches newline by default (closes #111) 2017-10-14 16:12:11 +02:00
sharkdp c38ef0e9b2 Fix description of smart-case in help text 2017-10-14 12:09:34 +02:00
sharkdp be2238ddf4 Fix Cargo warnings 2017-10-14 12:04:57 +02:00
Matthias Reitinger 7150c9a3a9 Refactor output.rs 2017-10-14 11:11:06 +02:00
Matthias Reitinger 0b04f39398 Split up print_entry in colorized and uncolorized helper functions. 2017-10-14 11:11:06 +02:00
Matthias Reitinger 0677e6331d Fix too many path separators on Windows (#93). 2017-10-14 11:11:06 +02:00
Matthias Reitinger b441528067 Improve smart case to only consider literal uppercase chars (#103) 2017-10-14 11:03:21 +02:00
sharkdp 8fc3a83d92 Use absolute path to perform search, fixes #81
Previously, we were using the relative path to extract the search
string. For the current directory, the returned relative path was equal
to `""`. This is why the current directory did not show in the search
results (see #81).

This commit also changes the way that `--full-path` works, which was
previously working on relative paths. It seems more useful to search the
absolute path, though. Otherwise, search results could change just by
calling fd (with a given search path) from a different directory.
2017-10-13 18:16:26 +02:00
Antti Keränen 97e3110333 Make Travis check that the code is correctly formatted
Closes #99.
2017-10-12 21:53:20 +02:00
Antti Keränen 049b9ec06b Format the source code using rustfmt 2017-10-12 19:33:14 +02:00
J.W e075e1cf7c Add -i, --ignore-case 2017-10-12 07:28:05 +02:00
Rav Chandra 35e5ecd492 liberally accept >2 -u options as per ripgrep 2017-10-11 23:15:21 +02:00
Rav Chandra 4f2d9e77b3 Add ripgrep aliases for no-ignore and hidden 2017-10-11 23:15:21 +02:00
Garrett Squire ccb899a511 break main into separate modules 2017-10-11 08:21:09 +02:00
Jean-Christophe Petkovich affe41949d Switch symlink arg from 's' to 'l' (#83)
closes #80
2017-10-09 21:25:30 +02:00
Oli Lalonde 68a85c7e5b Update README.md 2017-10-08 22:52:43 +02:00
sharkdp b9b6964f30 Small update for the tutorial 2017-10-08 21:46:29 +02:00
David Peter 0cd9d8c3a6 Link to benchmark section 2017-10-08 20:54:54 +02:00
David Peter 108fce3396 Add first version of CONTRIBUTING.md 2017-10-07 22:01:52 +02:00
sharkdp a7f4a0a581 Re-enable macOS on Travis, both nightly and stable
fixes #69
2017-10-07 21:59:06 +02:00
David Peter b98e4c9931 Update development instructions 2017-10-07 16:19:47 +02:00
David Peter 43b124cf19 Add Windows install instructions 2017-10-07 16:18:19 +02:00
sharkdp 20e179c91d Fix appveyor deploy script 2017-10-07 16:03:07 +02:00
sharkdp d8da6ec83c Update long help text 2017-10-07 15:15:30 +02:00
David Peter 4731dc670c Enhanced Windows support, see #70
* Use easier way to convert path components
* Fix failing tests on Windows
2017-10-07 09:40:44 +02:00
Alejandro Baez a84536a173 app: refactor to ripgrep style for long_help 2017-10-07 09:13:39 +02:00
sharkdp 080e8a9b6e First update for tutorial 2017-10-06 17:07:26 +02:00
Ricky 3b55edf5dd Add examples to README (#68)
closes #57
2017-10-06 16:31:04 +02:00
sharkdp 0aae4a3d46 Update help text 2017-10-05 21:35:22 +02:00
sharkdp 34e4620e26 Code style udpates 2017-10-05 21:31:44 +02:00
sharkdp 2403ac350a cargo update 2017-10-05 00:01:56 +02:00
Matthias Reitinger 6f22957cdc Re-write integration tests in Rust (#67)
* Rewrite integration tests in Rust.
* Improve failure output for integration tests.
* Move TestEnv to separate module.
* Remove old integration tests script.
* Re-add integration test for subdirectory.
2017-10-04 23:19:30 +02:00
sharkdp 00b57b50ae Include PowerShell completion script in release
See #64
2017-10-04 20:48:43 +02:00
Florian Hofmair 396b9baaa5 Use clap to generate shell completions 2017-10-04 18:00:25 +02:00
David Peter 083b1cfd9b Update USAGE. 2017-10-03 20:23:53 +02:00
Antti Keränen 4ec33d064c Add a comment about the default value of --threads 2017-10-03 20:21:49 +02:00
sharkdp 7399558a06 Re-structure '--help' text 2017-10-03 19:30:39 +02:00
Antti Keränen 4b61beaa75 Add flag to force color
Color can now be forced on even when piping the output. Changed the
--no-color flag to --color which uses the same options that ripgrep
uses for --color (excluding ansi).

Closes #49.
2017-10-03 18:32:24 +02:00
Matthias Reitinger 2256affd8f Fix extension comparison logic 2017-10-03 18:28:54 +02:00
Matthias Reitinger b0fb774c0e Fix test suite name 2017-10-03 18:28:54 +02:00
Matthias Reitinger 32a321aafd Extract entry extension only when there is an extension filter 2017-10-03 18:28:54 +02:00
Matthias Reitinger 83db8673cf Add extension filtering 2017-10-03 18:28:54 +02:00
sharkdp 8073635177 Add badges 2017-09-27 21:47:41 +02:00
sharkdp 60df14f0a3 Fix build on Windows 2017-09-27 21:25:50 +02:00
sharkdp 042959a4af Add appveyor.yml file 2017-09-27 21:21:26 +02:00
David Peter 89124b317e Remove link to fd-rs-git 2017-09-27 20:53:25 +02:00
sharkdp adaf4f6d73 Reduce number of 'stat' syscalls from 3 to 1, see #36 2017-09-18 19:27:26 +02:00
David Peter d8c588d805 Add crates.io badge 2017-09-17 13:17:40 +02:00
David Peter df44407b84 Formatting of help text 2017-09-17 09:45:54 +02:00
64 changed files with 13245 additions and 1307 deletions
+9
View File
@@ -0,0 +1,9 @@
# On Windows MSVC, statically link the C runtime so that the resulting EXE does
# not depend on the vcruntime DLL.
#
# See: https://github.com/sharkdp/fd/issues/1874
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
[target.i686-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
+1
View File
@@ -0,0 +1 @@
github: [sharkdp, tavianator]
+42
View File
@@ -0,0 +1,42 @@
name: Bug Report
description: Report a bug.
title: "[BUG] "
labels: bug
body:
- type: markdown
attributes:
value: |
Please check out the [troubleshooting section](https://github.com/sharkdp/fd#troubleshooting) first.
- type: checkboxes
attributes:
label: Checks
options:
- label: I have read the troubleshooting section and still think this is a bug.
required: true
- type: textarea
id: bug
attributes:
label: "Describe the bug you encountered:"
validations:
required: true
- type: textarea
id: expected
attributes:
label: "Describe what you expected to happen:"
- type: input
id: version
attributes:
label: "What version of `fd` are you using?"
placeholder: "paste the output of `fd --version` here"
validations:
required: true
- type: textarea
id: os
attributes:
label: Which operating system / distribution are you on?
placeholder: |
Unix: paste the output of `uname -srm` and `lsb_release -a` here.
Windows: please tell us your Windows version
render: shell
validations:
required: true
+1
View File
@@ -0,0 +1 @@
blank_issues_enabled: true
@@ -0,0 +1,8 @@
---
name: Feature Request
about: Suggest an idea for this project.
title: ''
labels: feature-request
assignees: ''
---
+13
View File
@@ -0,0 +1,13 @@
---
name: Question
about: Ask a question about 'fd'.
title: ''
labels: question
assignees: ''
---
**What version of `fd` are you using?**
[paste the output of `fd --version` here]
+14
View File
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "monthly"
cooldown:
default-days: 7
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
cooldown:
default-days: 7
+277
View File
@@ -0,0 +1,277 @@
name: CICD
env:
CICD_INTERMEDIATES_DIR: "_cicd-intermediates"
MSRV_FEATURES: "--all-features"
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
tags:
- '*'
permissions:
contents: read
jobs:
crate_metadata:
name: Extract crate metadata
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Extract crate information
id: crate_metadata
run: |
echo "name=fd" | tee -a $GITHUB_OUTPUT
cargo metadata --no-deps --format-version 1 | jq -r '"version=" + .packages[0].version' | tee -a $GITHUB_OUTPUT
cargo metadata --no-deps --format-version 1 | jq -r '"maintainer=" + .packages[0].authors[0]' | tee -a $GITHUB_OUTPUT
cargo metadata --no-deps --format-version 1 | jq -r '"homepage=" + .packages[0].homepage' | tee -a $GITHUB_OUTPUT
cargo metadata --no-deps --format-version 1 | jq -r '"msrv=" + .packages[0].rust_version' | tee -a $GITHUB_OUTPUT
outputs:
name: ${{ steps.crate_metadata.outputs.name }}
version: ${{ steps.crate_metadata.outputs.version }}
maintainer: ${{ steps.crate_metadata.outputs.maintainer }}
homepage: ${{ steps.crate_metadata.outputs.homepage }}
msrv: ${{ steps.crate_metadata.outputs.msrv }}
ensure_cargo_fmt:
name: Ensure 'cargo fmt' has been run
runs-on: ubuntu-22.04
steps:
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- run: cargo fmt -- --check
lint_check:
name: Ensure 'cargo clippy' has no warnings
runs-on: ubuntu-latest
steps:
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- run: cargo clippy --all-targets --all-features -- -Dwarnings
min_version:
name: Minimum supported rust version
runs-on: ubuntu-22.04
needs: crate_metadata
steps:
- name: Checkout source code
uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Install rust toolchain (v${{ needs.crate_metadata.outputs.msrv }})
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ needs.crate_metadata.outputs.msrv }}
components: clippy
- name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)
run: cargo clippy --locked --all-targets "${MSRV_FEATURES}"
- name: Run tests
run: cargo test --locked "${MSRV_FEATURES}"
build:
name: '${{ matrix.job.target }} (${{ matrix.job.os }})'
runs-on: ${{ matrix.job.os }}
needs: crate_metadata
permissions:
id-token: write
contents: write
attestations: write
strategy:
fail-fast: false
matrix:
job:
- { target: aarch64-unknown-linux-gnu , os: ubuntu-24.04, use-cross: true }
- { target: aarch64-unknown-linux-musl , os: ubuntu-24.04, use-cross: true }
- { target: arm-unknown-linux-gnueabihf , os: ubuntu-24.04, use-cross: true }
- { target: arm-unknown-linux-musleabihf, os: ubuntu-24.04, use-cross: true }
- { target: i686-pc-windows-msvc , os: windows-2025 }
- { target: i686-unknown-linux-gnu , os: ubuntu-24.04, use-cross: true }
- { target: i686-unknown-linux-musl , os: ubuntu-24.04, use-cross: true }
- { target: x86_64-apple-darwin , os: macos-26-intel }
- { target: aarch64-apple-darwin , os: macos-26 }
- { target: x86_64-pc-windows-gnu , os: windows-2025 }
- { target: x86_64-pc-windows-msvc , os: windows-2025 }
- { target: aarch64-pc-windows-msvc , os: windows-11-arm }
- { target: x86_64-unknown-linux-gnu , os: ubuntu-24.04, use-cross: true }
- { target: x86_64-unknown-linux-musl , os: ubuntu-24.04, use-cross: true }
env:
BUILD_CMD: "${{ matrix.job.use-cross && 'cross' || 'cargo' }}"
target: ${{ matrix.job.target }}
name: ${{ needs.crate_metadata.outputs.name }}
steps:
- name: Checkout source code
uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Install prerequisites
shell: bash
run: |
case ${target} in
arm-unknown-linux-*) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
esac
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.job.target }}
toolchain: "stable"
- name: Install cross
if: matrix.job.use-cross
env:
cross_version: "v0.2.5"
package_name: "cross-x86_64-unknown-linux-gnu.tar.gz"
GH_TOKEN: "${{ github.token }}"
run: |
dir="$HOME/.local/bin/"
mkdir -p "$dir"
gh release download --repo cross-rs/cross \
--pattern "${package_name}" -O - "${cross_version}" \
| tar -C "$dir" -xz
echo "$dir" >> $GITHUB_PATH
echo "Installed cross $cross_version" >> $GITHUB_STEP_SUMMARY
- name: Show version information (Rust, cargo, GCC)
shell: bash
run: |
gcc --version || true
rustup -V
rustup toolchain list
rustup default
cargo -V
rustc -V
- name: Build
shell: bash
run: $BUILD_CMD build --locked --release --target="${target}"
- name: Set binary name & path
id: bin
shell: bash
run: |
# Figure out suffix of binary
EXE_suffix=""
case ${target} in
*-pc-windows-*) EXE_suffix=".exe" ;;
esac;
# Setup paths
BIN_NAME="${name}${EXE_suffix}"
BIN_PATH="target/${target}/release/${BIN_NAME}"
# Let subsequent steps know where to find the binary
echo "BIN_PATH=${BIN_PATH}" >> $GITHUB_OUTPUT
echo "BIN_NAME=${BIN_NAME}" >> $GITHUB_OUTPUT
- name: Set testing options
id: test-options
shell: bash
run: |
# test only library unit tests and binary for arm-type targets
unset CARGO_TEST_OPTIONS
case ${target} in
arm-* | aarch64-*)
CARGO_TEST_OPTIONS="--bin=${name}" ;;
esac
echo "CARGO_TEST_OPTIONS=${CARGO_TEST_OPTIONS}" >> $GITHUB_OUTPUT
- name: Run tests
shell: bash
env:
cargo_test_options: ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
run: $BUILD_CMD test --locked --target="${target}" "${cargo_test_options}"
- name: Generate completions
id: completions
shell: bash
run: make completions
- name: Create tarball
id: package
shell: bash
run: bash scripts/create-archive.sh
env:
BIN_PATH: ${{ steps.bin.outputs.BIN_PATH }}
TARGET: ${{ env.target }}
ARCHIVE_NAME: ${{ env.name }}-v${{ needs.crate_metadata.outputs.version }}-${{ env.target }}
PKG_STAGING: "${{ env.CICD_INTERMEDIATES_DIR }}/package"
- name: Create Debian package
id: debian-package
shell: bash
if: startsWith(matrix.job.os, 'ubuntu')
run: bash scripts/create-deb.sh
env:
TARGET: ${{ matrix.job.target }}
DPKG_VERSION: ${{ needs.crate_metadata.version }}
BIN_PATH: ${{ steps.bin.outputs.BIN_PATH }}
- name: "Artifact upload: tarball"
id: upload-tarball
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ${{ steps.package.outputs.PKG_NAME }}
path: ${{ steps.package.outputs.PKG_PATH }}
compression-level: 0 # tarball is already compressed
- name: "Artifact upload: Debian package"
id: upload-deb
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: steps.debian-package.outputs.DPKG_NAME
with:
name: ${{ steps.debian-package.outputs.DPKG_NAME }}
path: ${{ steps.debian-package.outputs.DPKG_PATH }}
compression-level: 0 # deb files are already compressed
- name: Check for release
id: is-release
shell: bash
run: |
unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_OUTPUT
- name: "Attest artifacts"
uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4
if: steps.is-release.outputs.IS_RELEASE
with:
subject-path: |
${{ steps.package.outputs.PKG_PATH }}
${{ steps.debian-package.outputs.DPKG_PATH }}
- name: Publish archives and packages
uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3.0.2
if: steps.is-release.outputs.IS_RELEASE
with:
files: |
${{ steps.package.outputs.PKG_PATH }}
${{ steps.debian-package.outputs.DPKG_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
winget:
name: Publish to Winget
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: vedantmgoyal9/winget-releaser@4ffc7888bffd451b357355dc214d43bb9f23917e # v2
with:
identifier: sharkdp.fd
installers-regex: '-pc-windows-msvc\.zip$'
token: ${{ secrets.WINGET_TOKEN }}
+2
View File
@@ -1,2 +1,4 @@
target/
/autocomplete/
/package/
**/*.rs.bk
-41
View File
@@ -1,41 +0,0 @@
language: rust
rust:
- stable
- beta
- nightly
matrix:
allow_failures:
- rust: nightly
include:
# Nightly channel.
- os: linux
rust: nightly
env: TARGET=i686-unknown-linux-musl
- os: linux
rust: nightly
env: TARGET=x86_64-unknown-linux-musl
# currently disabled
# - os: osx
# rust: nightly
# env: TARGET=x86_64-apple-darwin
# Beta channel.
- os: linux
rust: beta
env: TARGET=x86_64-unknown-linux-musl
- os: linux
rust: beta
env: TARGET=x86_64-unknown-linux-gnu
# Minimum Rust supported channel.
- os: linux
rust: 1.16.0
env: TARGET=x86_64-unknown-linux-gnu
- os: linux
rust: 1.16.0
env: TARGET=x86_64-unknown-linux-musl
after_success:
- bash tests/test.sh
notifications:
email:
on_success: never
+876
View File
@@ -0,0 +1,876 @@
# Upcoming Release
## Features
-
## Bugfixes
-
# 10.5.0
## Features
- Add `--ignore-parent` option to override `--no-ignore-parent`, see #1958 (@tmchow)
- Add `--exact` option to match the entire filename exactly (literal, non-substring).
## Bugfixes
- Sanitize control characters and bidirectional override characters in filenames
when output goes to a terminal, to prevent terminal escape-sequence injection.
Also reject a placeholder as the executable for `--exec-batch`, while still
allowing it for `--exec`.
- Handle invalid working directories gracefully when using `--full-path`, see #1900 (@Xavrir).
- Fire the "search pattern contains a path separator" diagnostic for any pattern containing `/`, not just patterns that happen to name an existing directory. Preserves the legacy Windows behaviour that also flags native `\` separators when the pattern resolves to a real directory. See #1873.
- Also fire the "search pattern contains a path separator" diagnostic for `--and` patterns, not only the primary positional pattern. `--and` patterns are matched against the file name just like the primary pattern, so a path separator in them silently returned zero results. See #1873.
- Fix bug where passing "-" as a directory argument didn't actually search that directory, see #849 (@Sean-Kenneth-Doherty).
- Fix panic when `--changed-before`/`--changed-within` is given an out-of-range `@` Unix timestamp; the value is now rejected gracefully, see #2081 (@nikolauspschuetz).
# 10.4.2
## Bugfixes
- Fixed performance regression due to `--ignore-contain`; see #1913 and #1914
# 10.4.1
This is just a re-release of 10.4.0 due to an issue with the 10.4.0 release.
# 10.4.0
## Features
- Add `--ignore-contain` option to ignore directories containing a named entry (e.g. to ignore [`CACHEDIR.TAG`](https://bford.info/cachedir/)); see #1727 (@fischman).
## Bugfixes
- Fix Windows hyperlink generation for paths with spaces. (#1872)
- `--print0` combined with `--exec` will now print a `\0` between the output of each entry. Note that if there are multiple instances
of `--exec`, the `\0` will be between each _set_ of commands, _not_ between each individual command run. Fixes #1797.
- Several bugs were fixed by an update to the `ignore` library used for handling ignore rules
- #1506
- #1667
- #1813
- Fix completions for alias `fdfind` in deb release, see #1888 (@skane-lukas)
## Changes
- Minimum required rust version has been increased to 1.90.0. Notably, this means dropping fully support for intel Mac and Windows 7.
- Statically link the CRT for MSVC builds via Cargo config to avoid runtime DLL dependencies, see #1874 (@FidelSch)
# 10.3.0
## Features
- Add a hidden `--mindepth` alias for `--min-depth`. (#1617)
## Bugfixes
## Changes
- Replace `humantime` crate and `chrono` crate with `jiff` crate, see #1690 (@sorairolake). This has some small changes to the
way dates given to options such `--changed-within` and `--changed-before` including:
- 'M' no longer means "month", as that could be confusing with minutes. Use "mo", "mos", "month" or "months" instead.
- month and year now account for variability in the calander rather than being a hard-coded number of seconds. That is probably
what you would expect, but it is a slight change in behavior.
- aarch64 Windows was added to CI and release artifacts
- Many dependencies were updated
- Better support building on Illumos (there is no automated testing, but some known issues were fixed)
## Other
This will be the last release that has been tested on x86_64 Mac OS, since GitHub is
dropping support for runners with that hardware.
It may also be the last release to use a version of Rust with tier-1 support for
x86_64/intel Macs and Windows 7.
# 10.2.0
## Features
- Add --hyperlink option to add OSC 8 hyperlinks to output
## Bugfixes
## Changes
- Build windows releases with rust 1.77 so windows 7 is still supported
- Deb packages now include symlink for fdfind to be more consistent with official packages
## Other
# 10.1.0
## Features
- Allow passing an optional argument to `--strip-cwd-prefix` of "always", "never", or "auto". to force whether the cwd prefix is stripped or not.
- Add a `--format` option which allows using a format template for direct ouput similar to the template used for `--exec`. (#1043)
## Bugfixes
- Fix aarch64 page size again. This time it should actually work. (#1085, #1549) (@tavianator)
## Other
- aarch64-apple-darwin target added to builds on the release page. Note that this is a tier 2 rust target.
# v10.0.0
## Features
- Add `dir` as an alias to `directory` when using `-t` \ `--type`, see #1460 and #1464 (@Ato2207).
- Add support for @%s date format in time filters similar to GNU date (seconds since Unix epoch for --older/--newer), see #1493 (@nabellows)
- Breaking: No longer automatically ignore `.git` when using `--hidden` with vcs ignore enabled. This reverts the change in v9.0.0. While this feature
was often useful, it also broke some existing workflows, and there wasn't a good way to opt out of it. And there isn't really a good way for us to add
a way to opt out of it. And you can easily get similar behavior by adding `.git/` to your global fdignore file.
See #1457.
## Bugfixes
- Respect NO_COLOR environment variable with `--list-details` option. (#1455)
- Fix bug that would cause hidden files to be included despite gitignore rules
if search path is "." (#1461, BurntSushi/ripgrep#2711).
- aarch64 builds now use 64k page sizes with jemalloc. This fixes issues on some systems, such as ARM Macs that
have a larger system page size than the system that the binary was built on. (#1547)
- Address [CVE-2024-24576](https://blog.rust-lang.org/2024/04/09/cve-2024-24576.html), by increasing minimum rust version.
## Changes
- Minimum supported rust version is now 1.77.2
# v9.0.0
## Performance
- Performance has been *significantly improved*, both due to optimizations in the underlying `ignore`
crate (#1429), and in `fd` itself (#1422, #1408, #1362) - @tavianator.
[Benchmarks results](https://gist.github.com/tavianator/32edbe052f33ef60570cf5456b59de81) show gains
of 6-8x for full traversals of smaller directories (100k files) and up to 13x for larger directories (1M files).
- The default number of threads is now constrained to be at most 64. This should improve startup time on
systems with many CPU cores. (#1203, #1410, #1412, #1431) - @tmccombs and @tavianator
- New flushing behavior when writing output to stdout, providing better performance for TTY and non-TTY
use cases, see #1452 and #1313 (@tavianator).
## Features
- Support character and block device file types, see #1213 and #1336 (@cgzones)
- Breaking: `.git/` is now ignored by default when using `--hidden` / `-H`, use `--no-ignore` / `-I` or
`--no-ignore-vcs` to override, see #1387 and #1396 (@skoriop)
## Bugfixes
- Fix `NO_COLOR` support, see #1421 (@acuteenvy)
## Other
- Fixed documentation typos, see #1409 (@marcospb19)
## Thanks
Special thanks to @tavianator for his incredible work on performance in the `ignore` crate and `fd` itself.
# v8.7.1
## Bugfixes
- `-1` properly conflicts with the exec family of options.
- `--max-results` overrides `-1`
- `--quiet` properly conflicts with the exec family of options. This used to be the case, but broke during the switch to clap-derive
- `--changed-within` now accepts a space as well as a "T" as the separator between date and time (due to update of chrono dependency)
## Other
- Many dependencies were updated
- Some documentation was updated and fixed
# v8.7.0
## Features
- Add flag --no-require-git to always respect gitignore files, see #1216 (@vegerot)
## Bugfixes
- Fix logic for when to use global ignore file. There was a bug where the only case where the
global ignore file wasn't processed was if `--no-ignore` was passed, but neither `--unrestricted`
nor `--no-global-ignore-file` is passed. See #1209
# v8.6.0
## Features
- New `--and <pattern>` option to add additional patterns that must also be matched. See #315
and #1139 (@Uthar)
- Added `--changed-after` as alias for `--changed-within`, to have a name consistent with `--changed-before`.
## Changes
- Breaking: On Unix-like systems, `--type executable` now additionally checks if
the file is executable by the current user, see #1106 and #1169 (@ptipiak)
## Bugfixes
- Use fd instead of fd.exe for Powershell completions (when completions are generated on windows)
## Other
# v8.5.3
## Bugfixes
- Fix completion generation to not include full path of fd command
- Fix build error if completions feature is disabled
# v8.5.2
## Bugfixes
- Fix --owner option value parsing, see #1163 and #1164 (@tmccombs)
# v8.5.1
## Bugfixes
- Fix --threads/-j option value parsing, see #1160 and #1162 (@sharkdp)
# v8.5.0
## Features
- `--type executable`/`-t` now works on Windows, see #1051 and #1061 (@tavianator)
## Bugfixes
- Fixed differences between piped / non-piped output. This changes `fd`s behavior back to what we
had before 8.3.0, i.e. there will be no leading `./` prefixes, unless `--exec`/`-x`,
`--exec-batch`/`-X`, or `--print0`/`-0` are used. `--strip-cwd-prefix` can be used to strip that
prefix in those cases. See #1046, #1115, and #1121 (@tavianator)
- `fd` could previously crash with a panic due to a race condition in Rusts standard library
(see https://github.com/rust-lang/rust/issues/39364). This has been fixed by switching to a different
message passing implementation, see #1060 and #1146 (@tavianator)
- `fd`s memory usage will not grow unboundedly on huge directory trees, see #1146 (@tavianator)
- fd returns an error when current working directory does not exist while a search path is
specified, see #1072 (@vijfhoek)
- Improved "command not found" error message, see #1083 and #1109 (@themkat)
- Preserve command exit codes when using `--exec-batch`, see #1136 and #1137 (@amesgen)
## Changes
- No leading `./` prefix for non-interactive results, see above.
- fd now colorizes paths in parallel, significantly improving performance, see #1148 (@tavianator)
- fd can now avoid `stat` syscalls even when colorizing paths, as long as the color scheme doesn't
require metadata, see #1148 (@tavianator)
- The statically linked `musl` versions of `fd` now use `jmalloc`, leading to a significant performance
improvement, see #1062 (@tavianator)
## Other
- Added link back to GitHub in man page and `--help` text, see #1086 (@scottchiefbaker)
- Major update in how `fd` handles command line options internally, see #1067 (@tmccombs)
# v8.4.0
## Features
- Support multiple `--exec <cmd>` instances, see #406 and #960 (@tmccombs)
## Bugfixes
- "Argument list too long" errors can not appear anymore when using `--exec-batch`/`-X`, as the command invocations are automatically batched at the maximum possible size, even if `--batch-size` is not given. See #410 and #1020 (@tavianator)
## Changes
- Directories are now printed with an additional path separator at the end: `foo/bar/`, see #436 and #812 (@yyogo)
- The `-u` flag was changed to be equivalent to `-HI` (previously, a single `-u` was only equivalent to `-I`). Additional `-u` flags are still allowed, but ignored. See #840 and #986 (@jacksontheel)
## Other
- Added installation instructions for RHEL8, see #989 (@ethsol)
# v8.3.2
## Bugfixes
- Invalid absolute path on windows when searching from the drive root, see #931 and #936 (@gbarta)
# v8.3.1
## Bugfixes
- Stop implying `--no-ignore-parent` when `--no-vcs-ignore` is supplied, see #907, #901, #908 (@tmccombs)
- fd no longer waits for the whole traversal if the only matches arrive within max_buffer_time, see #868 and #895 (@tavianator)
- `--max-results=1` now immediately quits after the first result, see #867
- `fd -h` does not panic anymore when stdout is closed, see #897
## Changes
- Disable jemalloc on FreeBSD, see #896 (@xanderio)
- Updated man page, see #912 (@rlue)
- Updated zsh completions, see #932 (@tmccombs)
# v8.3.0
## Performance improvements
- Colorized output is now significantly faster, see #720 and #853 (@tavianator)
- Writing to stdout is now buffered if the output does not go to a TTY. This increases performance
when the output of `fd` is piped to another program or to a file, see #885 (@tmccombs, original
implementation by @sourlemon207)
- File metadata is now cached between the different filters that require it (e.g. `--owner`,
`--size`), reducing the number of `stat` syscalls when multiple filters are used; see #863
(@tavianator, original implementation by @alexmaco)
## Features
- Don't buffer command output from `--exec` when using a single thread. See #522
- Add new `-q, --quiet` flag, see #303 (@Asha20)
- Add new `--no-ignore-parent` flag, see #787 (@will459)
- Add new `--batch-size` flag, see #410 (@devonhollowood)
- Add opposing command-line options, see #595 (@Asha20)
- Add support for more filesystem indicators in `LS_COLORS`, see
https://github.com/sharkdp/lscolors/pull/35 (@tavianator)
## Bugfixes
- Always show the `./` prefix for search results unless the output is a TTY or `--strip-cwd-prefix` is set, see #760 and #861 (@jcaplan)
- Set default path separator to `/` in MSYS, see #537 and #730 (@aswild)
- fd cannot search files under a RAM disk, see #752
- fd doesn't show substituted drive on Windows, see #365
- Properly handle write errors to devices that are full, see #737
- Use local time zone for time functions (`--change-newer-than`, `--change-older-than`), see #631 (@jacobmischka)
- Support `--list-details` on more platforms (like BusyBox), see #783
- The filters `--owner`, `--size`, and `--changed-{within,before}` now apply to symbolic links
themselves, rather than the link target, except when `--follow` is specified; see #863
- Change time comparisons to be exclusive, see #794 (@jacobmischka)
## Changes
- Apply custom `--path-separator` to commands run with `--exec(-batch)` and `--list-details`, see #697 (@aswild)
## Other
- Many documentation updates
# v8.2.1
No functional changes with respect to v8.2.0. Bugfix in the release process.
# v8.2.0
## Features
- Add new `--prune` flag, see #535 (@reima)
- Improved the usability of the time-based options, see #624 and #645 (@gorogoroumaru)
- Add support for exact file sizes in the `--size` filter, see #669 and #696 (@Rogach)
- `fd` now prints an error message if the search pattern requires a leading dot but
`--hidden` is not enabled (Unix only), see #615
## Bugfixes
- Avoid panic when performing limited searches in directories with restricted permissions, see #678
- Invalid numeric command-line arguments are silently ignored, see #675
- Disable jemalloc on Android, see #662
- The `--help` text will be colorless if `NO_COLOR` has been set, see #600 (@xanonid)
## Changes
- If `LS_COLORS` is not set (e.g. on Windows), we now provide a more comprehensive default which
includes much more filetypes, see #604 and #682 (mjsir911).
## Other
- Added `zsh` completion files, see #654 and #189 (@smancill)
# v8.1.1
## Bugfixes
- Support colored output on older Windows versions if either (1) `--color=always` is set or (2) the `TERM` environment variable is set. See #469
# v8.1.0
## Features
- Add new `--owner [user][:group]` filter. See #307 (pull #581) (@alexmaco)
- Add support for a global ignore file (`~/.config/fd/ignore` on Unix), see #575 (@soedirgo)
- Do not exit immediately if one of the search paths is missing, see #587 (@DJRHails)
## Bugfixes
- Reverted a change from fd 8.0 that enabled colors on all Windows terminals (see below) in order to support older Windows versions again, see #577. Unfortunately, this re-opens #469
- Fix segfault caused by jemalloc on macOS Catalina, see #498
- Fix `--glob` behavior with empty pattern, see #579 (@SeamusConnor)
- Fix `--list-details` on FreeBSD, DragonFly BSD, OpenBSD and NetBSD. See #573 (@t6)
## Changes
- Updated documentation for `--size`, see #584
# v8.0.0
## Features
- Add a new `-l`/`--list-details` 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)
- Add a new `--max-results=<count>` option to limit the number of search results, see #472, #476 and #555
This can be useful to speed up searches in cases where you know that there are only N results.
Using this option is also (slightly) faster than piping to `head -n <count>` where `fd` can only
exit when it finds the search results `<count> + 1`.
- Add the alias `-1` for `--max-results=1`, see #561. (@SimplyDanny).
- Add new `--type socket` and `--type pipe` filters, see #511.
- Add new `--min-depth <depth>` and `--exact-depth <depth>` options in addition to the existing option
to limit the maximum depth. See #404.
- Support additional ANSI font styles in `LS_COLORS`: faint, slow blink, rapid blink, dimmed, hidden and strikethrough.
## Bugfixes
- Preserve non-UTF8 filenames: invalid UTF-8 filenames are now properly passed to child-processes
when using `--exec`, `--exec-batch` or `--list-details`. In `fd`'s output, we replace non-UTF-8
sequences with the "" character. However, if the output of `fd` goes to another process, we
print the actual bytes of the filename. For more details, see #558 and #295.
- `LS_COLORS` entries with unsupported font styles are not completely ignored, see #552
## Changes
- Colored output will now be enabled by default on older Windows versions.
This allows the use of colored output if the terminal supports it (e.g.
MinTTY, Git Bash). On the other hand, this will be a regression for users
on older Windows versions with terminals that do not support ANSI escape
sequences. Affected users can use an alias `fd="fd --color=never"` to
continue using `fd` without colors. There is no change of behavior for
Windows 10. See #469.
- When using `--glob` in combination with `--full-path`, a `*` character does not match a path
separation character (`/` or `\\`) anymore. You can use `**` for that. This allows things like
`fd -p -g '/some/base/path/*/*/*.txt'` which would previously match to arbitrary depths (instead
of exactly two folders below `/some/base/path`. See #404.
- "Legacy" support to use `fd -exec` (with a single dash) has been removed. Use `fd -x` or
`fd --exec` instead.
- Overall improved error handling and error messages.
## Other
- Korean translation of the README, see: [한국어](https://github.com/spearkkk/fd-kor) (@spearkkk)
# v7.5.0
## Features
- Added `--one-file-system` (aliases: `--mount`, `--xdev`) to not cross file system boundaries on Unix and Windows, see #507 (@FallenWarrior2k).
- Added `--base-directory` to change the working directory in which `fd` is run, see #509 and #475 (@hajdamak).
- `fd` will not use colored output if the `NO_COLOR` environment variable is set, see #550 and #551 (@metadave).
- `fd --exec` will return exit code 1 if one of the executed commands fails, see #526 and #531 (@fusillicode and @Giuffre)
## Bug Fixes
- Fixed 'command not found' error when using zsh completion, see #487 (@barskern).
- `fd -L` should include broken symlinks, see #357 and #497 (@tommilligan, @neersighted and @sharkdp)
- Display directories even if we don't have permission to enter, see #437 (@sharkdp)
## Changes
- A flag can now be passed multiple times without producing an error, see #488 and #496 (@rootbid).
- Search results are sorted when using the `-X` option to match the behaviour of piping to `xargs`, see #441 and #524 (@Marcoleni @crash-g).
# v7.4.0
## Performance improvements
- Reduce number of `stat` syscalls, improving the performance for searches where file metadata is
required (`--type`, `--size`, `--changed-within`, …), see #434 (@tavianator)
- Use jemalloc by default, improving the performance for almost all searches, see #481. Note that
Windows and `*musl*` builds do not profit from this.
## Features
- Added a new `-g`/`--glob` option to switch to glob-based searches (instead of regular expression
based searches). This is accompanied by a new `--regex` option that can be used to switch back,
if users want to `alias fd="fd --glob"`. See #284
- Added a new `--path-separator <sep>` option which can be useful for Windows users who
want/need `fd` to use `/` instead of `\`, see #428 and #153 (@mookid)
- Added support for hidden files on Windows, see #379
- When `fd` is run with the `--exec-batch`/`-X` option, it now exposes the exit status of the
command that was run, see #333.
- Exit immediately when Ctrl-C has been pressed twice, see #423
## Bugfixes
- Make `--changed-within`/`--changed-before` work for directories, see #470
## Other
- Pre-built `fd` binaries should now be available for `armhf` targets, see #457 (@detly)
- `fd` is now available on Alpine Linux, see #451 (@5paceToast)
- `fd` is now in the officla FreeBSD repositories, see #412 (@t6)
- Added OpenBSD install instructions, see #421 (@evitalis)
- Added metadata to the Debian package, see #416 (@cathalgarvey)
- `fd` can be installed via npm, see #438 (@pablopunk)
# v7.3.0
## Features
- New `--exec-batch <cmd>`/`-X <cmd>` option for batch execution of commands, see #360 (@kimsnj).
This allows you to do things like:
``` bash
fd … -X vim # open all search results in vim (or any other editor)
fd … -X ls -l # view detailed stats about the search results with 'ls'
fd -e svg -X inkscape # open all SVG files in Inkscape
```
- Support for 24-bit color codes (when specified via `LS_COLORS`) as well as
different font styles (bold, italic, underline).
## Changes
- A few performance improvements, in particular when printing lots of colorized
results to the console, see #370
- The `LS_COLORS` handling has been "outsourced" to a separate crate (https://github.com/sharkdp/lscolors) that is now being used by other tools as well: [fselect](https://github.com/jhspetersson/fselect), [lsd](https://github.com/Peltoche/lsd/pull/84). For details, see #363.
## Other
- `fd` will be available in Ubuntu Disco DIngo (19.04), see #373 (@sylvestre)
- This release should come with a static ARM binary (`arm-unknown-linux-musleabihf`), see #320 (@duncanfinney)
- Various documentation improvements, see #389
## Thanks
Special thanks to @alexmaco for his awesome work on refactoring and code improvements! (see #401, #398, and #383)
# v7.2.0
## Features
* Added support for filtering by file modification time by adding two new options `--changed-before <date|duration>` and `--changed-within <..>`. For more details, see the `--help` text, the man page, the relevant issue #165 and the PR #339 (@kimsnj)
* Added `--show-errors` option to enable the display of filesystem error messages such as "permission denied", see #311 (@psinghal20 and @majecty)
* Added `--maxdepth` as a (hidden) alias for `--max-depth`, see #323 (@mqudsi)
* Added `--search-path` option which can be supplied to replace the positional `path` argument at any position.
## Changes
* Loosen strict handling of missing `--ignore-file`, see #280 (@psinghal20)
* Re-enabled `.ignore` files, see #156.
## Bugfixes
* `fd` could previously get stuck when run from the root directory in the
presence of zombie processes. This curious bug has been fixed in Rust 1.29 and higher. For more details, see #288, [rust-lang/rust#50619](https://github.com/rust-lang/rust/issues/50619) and [the fix](https://github.com/rust-lang/rust/pull/50630)
## Other
* `fd` has officially landed in Debian! See #345 for details. Thanks goes to @sylvestre, @paride and possibly others I don't know about.
* Added Chinese translation of README (@chinanf-boy)
## Thanks
A special thanks goes to @joshleeb for his amazing improvements throughout
the code base (new tests, refactoring work and various other things)!
# v7.1.0
## Features
* Added `--size` filter option, see #276 (@stevepentland, @JonathanxD and @alexmaco)
* Added `--type empty` (or `-t e`) to search for empty files and/or directories, see #273
## Changes
* With the new version, `.gitignore` files will only be respected in Git repositories, not outside.
* A few performance improvements for `--type` searches, see 641976cf7ad311ba741571ca8b7f02b2654b6955 and 50a2bab5cd52d26d4a3bc786885a2c270ed3b227
## Other
* Starting with this release, we will offer pre-built ARM binaries, see #244
* Added instructions on how to use `fd` with `emacs`, see #282 (@redguardtoo)
* `fd` is now in the official openSUSE repositories, see #275 (@avindra)
* `fd` is now available via MacPorts, see #291 (@raimue)
# v7.0.0
## Features
* Added `--type executable` (or `-t x`) to search for executable files only, see #246 (@PramodBisht)
* Added support for `.fdignore` files, see #156 and #241.
* Added `--ignore-file` option to add custom ignore files, see #156.
* Suggest `--fixed-strings` on invalid regular expressions, see #234 (@PramodBisht)
* Detect when user supplied path instead of pattern, see #235.
## Changes
* `.ignore` and `.rgignore` files are not parsed anymore. Use `.fdignore` files
or add custom files via `--ignore-file` instead.
* Updated to `regex-syntax` 0.5 (@cuviper)
## Bugfixes
* Properly normalize absolute paths, see #268
* Invalid utf8 filenames displayed when `-e` is used, see #250
* If `--type` is used, fifos/sockets/etc. are always shown, see #260
## Other
* Packaging:
* The Arch Linux package is now simply called `fd`.
* There is now a `fd` ebuild for Gentoo Linux.
* There is a `scoop` package for `fd` (Windows).
* There is a `Chocolatey` package for `fd` (Windows).
* There is a Fedora `copr` package for `fd`.
# v6.3.0
## Features
* Files with multiple extensions can now be found via `--extension`/`-e`, see #214 (@althonos)
``` bash
> fd -e tar.gz
```
* Added new `-F`/`--fixed-strings`/`--literal` option that treats the pattern as a literal string instead of a regular expression, see #157
``` bash
> fd -F 'file(1).txt'
```
* Allow `-exec` to work as `--exec`, see #226 (@stevepentland)
## Bugfixes
* Fixed `Ctrl-C` handling when using `--exec`, see #224 (@Doxterpepper)
* Fixed wrong file owner for files in deb package, see #213
## Other
* Replaced old gif by a fancy new SVG screencast (@marionebl)
* Updated [benchmark results](https://github.com/sharkdp/fd#benchmark) (fd has become faster in the meantime!). There is a new repository that hosts several benchmarking scripts for fd: https://github.com/sharkdp/fd-benchmarks
# v6.2.0
## Features
* Support for filtering by multiple file extensions and multiple file types, see #199 and #177
(@tkadur).
For example, it's possible to search for C++ source or header files:
``` bash
> fd -e cpp -e c -e cxx -e h pattern
```
## Changes
* The size of the output buffer (for sorting search results) is now limited to 1000 entries. This
improves the search speed significantly if there are a lot of results, see #191 (@sharkdp).
## Bugfixes
* Fix a bug where long-running searches could not be killed via Ctrl-C, see #210 (@Doxterpepper)
* fd's exit codes are now in accordance with Unix standards, see #201 (@Doxterpepper)
## Other
* Bash, zsh and fish completion should now work with the Ubuntu `.deb` packages, see #195 and #209
(@tmccombs and @sharkdp)
* There is a new section on how to set up `fzf` to use `fd` in the
[README](https://github.com/sharkdp/fd#using-fd-with-fzf), see #168.
# v6.1.0
## Features
* Support for multiple search paths, see #166 (@Doxterpepper)
* Added `--no-ignore-vcs` option to disable `.gitignore` and other VCS ignore files,
without disabling `.ignore` files - see #156 (@ptzz).
## Bugfixes
* Handle terminal signals, see #128 (@Doxterpepper)
* Fixed hang on `--exec` when user input was required, see #178 and #193 (@reima)
## Other
* Debian packages are now created via Travis CI and should be available for this and all
future releases (@tmccombs).
* fd is now available on Void Linux (@maxice8)
* The minimum required Rust version is now 1.20
## Thanks
@Doxterpepper deserves a special mention for his great work that is included in this release and
for the support in ticket discussions and concerning Travis CI fixes. Thank you very much!
Thanks also go out to @tmccombs for the work on Debian packages and for reviewing a lot of pull requests!
# v6.0.0
## Changes
- The `--exec`/`-x` option does not spawn an intermediate shell anymore. This improves the
performance of parallel command execution and fixes a whole class of (present and potentially
future) problems with shell escaping. The drawback is that shell commands cannot directly be
called with `--exec`. See #155 for the full discussion. These changes have been implemented by
@reima (Thanks!).
## Bugfixes
- `--exec` does not escape cmd.exe metacharacters on Windows (see #155, as above).
## Other
* *fd* is now available in the FreeBSD ports (@andoriyu)
* The minimal `rustc` version is now checked when building with `cargo`, see #164 (@matematikaadit)
* The output directory for the shell completion files is created if it does not exist (@andoriyu)
# v5.0.0
## Features
* Added new `--exec`, `-x` option for parallel command execution (@mmstick, see #84 and #116). See the corresponding [README section](https://github.com/sharkdp/fd#parallel-command-execution) for an introduction.
* Auto-disable color output on unsupported Windows shells like `cmd.exe` (@iology, see #129)
* Added the `--exclude`, `-X` option to suppress certain files/directories in the search results
(see #89).
* Added ripgrep aliases `-u` and `-uu` for `--no-ignore` and `--no-ignore --hidden`, respectively
(@unsignedint, see #92)
* Added `-i`, `--ignore-case` (@iology, see #95)
* Made smart case really smart (@reima, see #103)
* Added RedoxOS support (@goyox86, see #131)
## Changes
* The dot `.` can now match newlines in file names (@iology, see #111)
* The short `--type` argument for symlinks has been changed from `s` to `l` (@jcpetkovich, see #83)
## Bugfixes
* Various improvements in root-path and symlink handling (@iology, see #82, #107, and #113)
* Fixed absolute path handling on Windows (@reima, #93)
* Fixed: current directory not included when using relative path (see #81)
* Fixed `--type` behavior for unknown file types (@iology, see #150)
* Some fixes around `--exec` (@iology, see #142)
## Other
* Major updates and bugfixes to our continuous integration and deployment tooling on Travis
(@matematikaadit, see #149, #145, #133)
* Code style improvements & automatic style checking via `rustfmt` on Travis (@Detegr, see #99)
* Added a man page (@pickfire, see #77)
* *fd* has been relicensed under the dual license MIT/Apache-2.0 (@Detegr, see #105)
* Major refactorings and code improvements (Big thanks to @gsquire, @reima, @iology)
* First version of [`CONTRIBUTING`](https://github.com/sharkdp/fd/blob/master/CONTRIBUTING.md) guidelines
* There is now a Nix package (@mehandes)
* *fd* is now in the official Arch Linux repos (@cassava)
* Improved tooling around shell completion files (@ImbaKnugel, see #124)
* Updated tutorial in the [`README`](https://github.com/sharkdp/fd/blob/master/README.md)
* The minimum required version of Rust has been bumped to 1.19.
## Thanks
A *lot* of things have happened since the last release and I'd like to thank all contributors for their great support. I'd also like to thank those that have contributed by reporting bugs and by posting feature requests.
I'd also like to take this chance to say a special Thank You to a few people that have stood out in one way or another: To @iology, for contributing a multitude of bugfixes, improvements and new features. To @reima and @Detegr for their continuing great support. To @mmstick, for implementing the most advanced new feature of *fd*. And to @matematikaadit for the CI/tooling upgrades.
# v4.0.0
## Features
* Added filtering by file extension, for example `fd -e txt`, see #56 (@reima)
* Add option to force colored output: `--color always`, see #49 (@Detegr)
* Generate Shell completions for Bash, ZSH, Fish and Powershell, see #64 (@ImbaKnugel)
* Better & extended `--help` text (@abaez and @Detegr)
* Proper Windows support, see #70
## Changes
* The integration tests have been re-written in Rust :sparkles:, making them platform-independent and easily callable via `cargo test` - see #65 (many thanks to @reima!)
* New tutorial in the README (@deg4uss3r)
* Reduced number of `stat` syscalls for each result from 3 to 1, see #36.
* Enabled Appveyor CI
# v3.1.0
## Features
- Added file type filtering, e.g. `find --type directory` or `find -t f` (@exitium)
# v3.0.0
## Features
- Directories are now traversed in parallel, leading to significant performance improvements (see [benchmarks](https://github.com/sharkdp/fd#benchmark))
- Added `--print0` option (@michaelmior)
- Added AUR packages (@wezm)
## Changes
- Changed short flag for `--follow` from `-f` to `-L` (consistency with `ripgrep`)
# v2.0.0
* Changed `--sensitive` to `--case-sensitive`
* Changed `--absolute` to `--absolute-path`
* Throw an error if root directory is not existent, see #39
* Use absolute paths if the root dir is an absolute path, see #40
* Handle invalid UTF-8, see #34 #38
* Support `-V`, `--version` by switching from `getopts` to `clap`.
Misc:
* It's now possible to install `fd` via homebrew on macOS: `brew install fd`.
# v1.1.0
- Windows compatibility (@sebasv), see #29 #35
- Safely exit on broken output pipes (e.g.: usage with `head`, `tail`, ..), see #24
- Backport for rust 1.16, see #23
# v1.0.0
* Respect `.(git)ignore` files
* Use `LS_COLORS` environment variable directly, instead of `~/.dir_colors` file.
* Added unit and integration tests
* Added optional second argument (search path)
# v0.3.0
- Parse dircolors files, closes #20
- Colorize each path component, closes #19
- Add short command line option for --hidden, see #18
# v0.2.0
- Option to follow symlinks, disable colors, closes #16, closes #17
- `--filename` instead of `--full-path`
- Option to search hidden directories, closes #12
- Configurable search depth, closes #13
- Detect interactive terminal, closes #11
# v0.1.0
Initial release
+54
View File
@@ -0,0 +1,54 @@
## Contributing to *fd*
**Thank you very much for considering contributing to this project!**
We welcome any form of contribution:
* New issues (feature requests, bug reports, questions, ideas, ...)
* Pull requests (documentation improvements, code improvements, new features, ...)
**Note**: Before you take the time to open a pull request, please open a ticket first. This will
give us the chance to discuss any potential changes first.
## Pull Request Expectations
1. Your contribution should be high quality, and best effort. In particular, please don't make a Pull Request
that was created using generative AI unless you have reviewed it yourself and understand what it does, and be
able to meaningfully answer questions and make changes to it as needed.
2. Your code should successfully compile and pass tests before publishing a Pull Request. It's understandable
if tests fail on one or two specific targets, but if the build doesn't pass for any targets, that is a signal
that the PR is low effort.
3. It is your responsibility to ensure that the generated code does not violate any copyrights or patents. This is
true of all contributions, but is especially relevant when using an LLM that may be generating output that is
very similar or even identical to existing code with an incompatible license.
4. If an AI coding assistant or other LLM tool was used, you must indicate that an AI tool was used, and to what extent it was used.
5. AI should not be used to generate comments when communicating with maintainers. We expect communication with the maintainers,
including PR descriptions and comments, to be from humans, not from an AI. Using an AI to assist with grammar, spelling, and
proofreading or translating is acceptable, as long as the content and voice of the
message is your own.
## Add an entry to the changelog
If your contribution changes the behavior of `fd` (as opposed to a typo-fix
in the documentation), please update the [`CHANGELOG.md`](CHANGELOG.md#upcoming-release) file
and describe your changes. This makes the release process much easier and
therefore helps to get your changes into a new `fd` release faster.
The top of the `CHANGELOG` contains an *"Upcoming release"* section with a few
subsections (Features, Bugfixes, …). Please add your entry to the subsection
that best describes your change.
Entries follow this format:
```
- Short description of what has been changed, see #123 (@user)
```
Here, `#123` is the number of the original issue and/or your pull request.
Please replace `@user` by your GitHub username.
## Important links
* [Open issues](https://github.com/sharkdp/fd/issues)
* [Open pull requests](https://github.com/sharkdp/fd/pulls)
* [Development section in the README](https://github.com/sharkdp/fd#development)
* [fd on crates.io](https://crates.io/crates/fd-find)
* [LICENSE-APACHE](https://github.com/sharkdp/fd/blob/master/LICENSE-APACHE) and [LICENSE-MIT](https://github.com/sharkdp/fd/blob/master/LICENSE-MIT)
Generated
+1082 -154
View File
File diff suppressed because it is too large Load Diff
+106 -15
View File
@@ -1,24 +1,115 @@
[package]
name = "fd-find"
version = "3.1.0"
authors = ["David Peter <mail@david-peter.de>"]
description = "fd is a simple, fast and user-friendly alternative to find."
homepage = "https://github.com/sharkdp/fd"
repository = "https://github.com/sharkdp/fd"
readme = "README.md"
keywords = ["search", "find", "file", "filesystem", "tool"]
categories = ["command-line-utilities"]
license = "MIT"
exclude = ["benchmarks"]
description = "fd is a simple, fast and user-friendly alternative to find."
exclude = ["/benchmarks/*"]
homepage = "https://github.com/sharkdp/fd"
documentation = "https://docs.rs/fd-find"
keywords = [
"search",
"find",
"file",
"filesystem",
"tool",
]
license = "MIT OR Apache-2.0"
name = "fd-find"
readme = "README.md"
repository = "https://github.com/sharkdp/fd"
version = "10.5.0"
edition= "2024"
rust-version = "1.90.0"
[badges.appveyor]
repository = "sharkdp/fd"
[badges.travis-ci]
repository = "sharkdp/fd"
[[bin]]
name = "fd"
path = "src/main.rs"
[dependencies]
ansi_term = "0.9"
clap = "2.26.0"
atty = "0.2"
regex = "0.2"
ignore = "0.2"
num_cpus = "1.6.2"
aho-corasick = "1.1"
nu-ansi-term = "0.50"
argmax = "0.4.0"
ignore = "0.4.25"
regex = "1.12.2"
regex-syntax = "0.8"
ctrlc = "3.5"
globset = "0.4"
anyhow = "1.0"
etcetera = "0.11"
normpath = "1.5.1"
crossbeam-channel = "0.5.15"
clap_complete = {version = "4.6.5", optional = true}
faccess = "0.2.4"
jiff = "0.2.27"
[dependencies.clap]
version = "4.6.1"
features = ["suggestions", "color", "wrap_help", "cargo", "derive"]
[dependencies.lscolors]
version = "0.21"
default-features = false
features = ["nu-ansi-term"]
[target.'cfg(unix)'.dependencies]
nix = { version = "0.31.1", default-features = false, features = ["signal", "user", "hostname"] }
[target.'cfg(all(unix, not(target_os = "redox")))'.dependencies]
libc = "0.2"
# FIXME: Re-enable jemalloc on macOS
# jemalloc is currently disabled on macOS due to a bug in jemalloc in combination with macOS
# Catalina. See https://github.com/sharkdp/fd/issues/498 for details.
# This has to be kept in sync with src/main.rs where the allocator for
# the program is set.
[target.'cfg(all(not(windows), not(target_os = "android"), not(target_os = "macos"), not(target_os = "freebsd"), not(target_os = "openbsd"), not(target_os = "illumos"), not(all(target_env = "musl", target_pointer_width = "32")), not(target_arch = "riscv64")))'.dependencies]
tikv-jemallocator = {version = "0.7.0", optional = true}
[dev-dependencies]
diff = "0.1"
tempfile = "3.27"
filetime = "0.2"
test-case = "3.3"
[profile.dev]
debug = "line-tables-only"
[profile.dev.package."*"]
debug = false
[profile.debugging]
inherits = "dev"
debug = true
[profile.release]
lto = true
strip = true
codegen-units = 1
[features]
use-jemalloc = ["tikv-jemallocator"]
completions = ["clap_complete"]
base = ["use-jemalloc"]
default = ["completions"]
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }.{ archive-format }"
bin-dir = "{ bin }-v{ version }-{ target }/{ bin }{ binary-ext }"
pkg-fmt = "tgz"
[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-fmt = "zip"
[package.metadata.binstall.overrides.x86_64-pc-windows-gnu]
pkg-fmt = "zip"
[package.metadata.binstall.overrides.i686-pc-windows-msvc]
pkg-fmt = "zip"
[package.metadata.binstall.overrides.aarch64-pc-windows-msvc]
pkg-fmt = "zip"
+6
View File
@@ -0,0 +1,6 @@
# https://github.com/sharkdp/fd/issues/1085
[target.aarch64-unknown-linux-gnu.env]
passthrough = ["JEMALLOC_SYS_WITH_LG_PAGE=16"]
[target.aarch64-unknown-linux-musl.env]
passthrough = ["JEMALLOC_SYS_WITH_LG_PAGE=16"]
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2017-2020 fd developers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2017 David Peter
Copyright (c) 2017-present The fd developers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+64
View File
@@ -0,0 +1,64 @@
PROFILE?=release
EXE=target/$(PROFILE)/fd
prefix=/usr/local
bindir=$(prefix)/bin
datadir=$(prefix)/share
exe_name=fd
ifdef VERSION
ARCHIVE_NAME = fd-v$(VERSION)
else
ARCHIVE_NAME = fd
endif
export ARCHIVE_NAME
archive_path=package/$(ARCHIVE_NAME).tar.gz
$(EXE): Cargo.toml src/**/*.rs
cargo build --profile $(PROFILE) --locked
.PHONY: completions
completions: autocomplete/fd.bash autocomplete/fd.fish autocomplete/_fd.ps1 autocomplete/_fd autocomplete/_fdfind autocomplete/fdfind.bash autocomplete/fdfind.fish
comp_dir=@mkdir -p autocomplete
autocomplete/fd.bash: $(EXE)
$(comp_dir)
$(EXE) --gen-completions bash > $@
autocomplete/fd.fish: $(EXE)
$(comp_dir)
$(EXE) --gen-completions fish > $@
autocomplete/_fd.ps1: $(EXE)
$(comp_dir)
$(EXE) --gen-completions powershell > $@
autocomplete/_fd: contrib/completion/_fd
$(comp_dir)
cp $< $@
autocomplete/_fdfind: contrib/completion/_fdfind
$(comp_dir)
cp $< $@
autocomplete/fdfind.bash: contrib/completion/fdfind.bash
$(comp_dir)
cp $< $@
autocomplete/fdfind.fish: contrib/completion/fdfind.fish
$(comp_dir)
cp $< $@
archive: $(archive_path)
$(archive_path): completions $(EXE)
bash scripts/create-archive.sh
install: $(EXE) completions
install -Dm755 $(EXE) $(DESTDIR)$(bindir)/fd
install -Dm644 autocomplete/fd.bash $(DESTDIR)/$(datadir)/bash-completion/completions/$(exe_name)
install -Dm644 autocomplete/fd.fish $(DESTDIR)/$(datadir)/fish/vendor_completions.d/$(exe_name).fish
install -Dm644 autocomplete/_fd $(DESTDIR)/$(datadir)/zsh/site-functions/_fd
install -Dm644 autocomplete/fdfind.bash $(DESTDIR)/$(datadir)/zsh/site-functions/fdfind.bash
install -Dm644 autocomplete/fdfind.fish $(DESTDIR)/$(datadir)/zsh/site-functions/fdfind.fish
install -Dm644 autocomplete/_fdfind $(DESTDIR)/$(datadir)/zsh/site-functions/_fdfind
install -Dm644 doc/fd.1 $(DESTDIR)/$(datadir)/man/man1/$(exe_name).1
+729 -100
View File
@@ -1,119 +1,736 @@
# fd
[![Build Status](https://travis-ci.org/sharkdp/fd.svg?branch=master)](https://travis-ci.org/sharkdp/fd)
*fd* is a simple, fast and user-friendly alternative to
[*find*](https://www.gnu.org/software/findutils/).
[![CICD](https://github.com/sharkdp/fd/actions/workflows/CICD.yml/badge.svg)](https://github.com/sharkdp/fd/actions/workflows/CICD.yml)
[![Version info](https://img.shields.io/crates/v/fd-find.svg)](https://crates.io/crates/fd-find)
[[中文](https://github.com/cha0ran/fd-zh)]
[[한국어](https://github.com/spearkkk/fd-kor)]
While it does not seek to mirror all of *find*'s powerful functionality, it provides sensible
(opinionated) defaults for [80%](https://en.wikipedia.org/wiki/Pareto_principle) of the use cases.
`fd` is a program to find entries in your filesystem.
It is a simple, fast and user-friendly alternative to [`find`](https://www.gnu.org/software/findutils/).
While it does not aim to support all of `find`'s powerful functionality, it provides sensible
(opinionated) defaults for a majority of use cases.
[Installation](#installation) • [How to use](#how-to-use) • [Troubleshooting](#troubleshooting)
## Features
* Convenient syntax: `fd PATTERN` instead of `find -iname '*PATTERN*'`.
* Colorized terminal output (similar to *ls*).
* It's *fast* (see benchmarks below).
* Intuitive syntax: `fd PATTERN` instead of `find -iname '*PATTERN*'`.
* Regular expression (default) and glob-based patterns.
* [Very fast](#benchmark) due to parallelized directory traversal.
* Uses colors to highlight different file types (same as `ls`).
* Supports [parallel command execution](#command-execution)
* Smart case: the search is case-insensitive by default. It switches to
case-sensitive if the pattern contains an uppercase
character[\*](http://vimdoc.sourceforge.net/htmldoc/options.html#'smartcase').
* Ignores hidden directories and files, by default.
* Ignores patterns from your `.gitignore`, by default.
* Regular expressions.
* Unicode-awareness.
* The command name is *50%* shorter[\*](https://github.com/ggreer/the_silver_searcher) than
`find` :-).
## Demo
![Demo](http://i.imgur.com/kTMFSVU.gif)
![Demo](doc/screencast.svg)
## Colorized output
`fd` can colorize files by extension, just like `ls`. In order for this to work, the environment
variable [`LS_COLORS`](https://linux.die.net/man/5/dir_colors) has to be set. Typically, the value
of this variable is set by the `dircolors` command which provides a convenient configuration format
to define colors for different file formats.
On most distributions, `LS_COLORS` should be set already. If you are looking for alternative, more
complete (and more colorful) variants, see
[here](https://github.com/seebi/dircolors-solarized) or
[here](https://github.com/trapd00r/LS_COLORS).
## How to use
First, to get an overview of all available command line options, you can either run
[`fd -h`](#command-line-options) for a concise help message or `fd --help` for a more detailed
version.
### Simple search
*fd* is designed to find entries in your filesystem. The most basic search you can perform is to
run *fd* with a single argument: the search pattern. For example, assume that you want to find an
old script of yours (the name included `netflix`):
``` bash
> fd netfl
Software/python/imdb-ratings/netflix-details.py
```
If called with just a single argument like this, *fd* searches the current directory recursively
for any entries that *contain* the pattern `netfl`.
### Regular expression search
The search pattern is treated as a regular expression. Here, we search for entries that start
with `x` and end with `rc`:
``` bash
> cd /etc
> fd '^x.*rc$'
X11/xinit/xinitrc
X11/xinit/xserverrc
```
The regular expression syntax used by `fd` is [documented here](https://docs.rs/regex/latest/regex/#syntax).
### Specifying the root directory
If we want to search a specific directory, it can be given as a second argument to *fd*:
``` bash
> fd passwd /etc
/etc/default/passwd
/etc/pam.d/passwd
/etc/passwd
```
### List all files, recursively
*fd* can be called with no arguments. This is very useful to get a quick overview of all entries
in the current directory, recursively (similar to `ls -R`):
``` bash
> cd fd/tests
> fd
testenv
testenv/mod.rs
tests.rs
```
If you want to use this functionality to list all files in a given directory, you have to use
a catch-all pattern such as `.` or `^`:
``` bash
> fd . fd/tests/
testenv
testenv/mod.rs
tests.rs
```
### Searching for a particular file extension
Often, we are interested in all files of a particular type. This can be done with the `-e` (or
`--extension`) option. Here, we search for all Markdown files in the fd repository:
``` bash
> cd fd
> fd -e md
CONTRIBUTING.md
README.md
```
The `-e` option can be used in combination with a search pattern:
``` bash
> fd -e rs mod
src/fshelper/mod.rs
src/lscolors/mod.rs
tests/testenv/mod.rs
```
### Searching for a particular file name
To find files with exactly the provided search pattern, use the `-g` (or `--glob`) option:
``` bash
> fd -g libc.so /usr
/usr/lib32/libc.so
/usr/lib/libc.so
```
### Hidden and ignored files
By default, *fd* does not search hidden directories and does not show hidden files in the
search results. To disable this behavior, we can use the `-H` (or `--hidden`) option:
``` bash
> fd pre-commit
> fd -H pre-commit
.git/hooks/pre-commit.sample
```
If we work in a directory that is a Git repository (or includes Git repositories), *fd* does not
search folders (and does not show files) that match one of the `.gitignore` patterns. To disable
this behavior, we can use the `-I` (or `--no-ignore`) option:
``` bash
> fd num_cpu
> fd -I num_cpu
target/debug/deps/libnum_cpus-f5ce7ef99006aa05.rlib
```
To really search *all* files and directories, simply combine the hidden and ignore features to show
everything (`-HI`) or use `-u`/`--unrestricted`.
### Matching the full path
By default, *fd* only matches the filename of each file. However, using the `--full-path` or `-p` option,
you can match against the full path.
```bash
> fd -u -p -g '**/.git/config'
> fd -p '.*/lesson-\d+/[a-z]+.(jpg|png)'
```
### Command execution
Instead of just showing the search results, you often want to *do something* with them. `fd`
provides two ways to execute external commands for each of your search results:
* The `-x`/`--exec` option runs an external command *for each of the search results* (in parallel).
* The `-X`/`--exec-batch` option launches the external command once, with *all search results as arguments*.
#### Examples
Recursively find all zip archives and unpack them:
``` bash
fd -e zip -x unzip
```
If there are two such files, `file1.zip` and `backup/file2.zip`, this would execute
`unzip file1.zip` and `unzip backup/file2.zip`. The two `unzip` processes run in parallel
(if the files are found fast enough).
Find all `*.h` and `*.cpp` files and auto-format them inplace with `clang-format -i`:
``` bash
fd -e h -e cpp -x clang-format -i
```
Note how the `-i` option to `clang-format` can be passed as a separate argument. This is why
we put the `-x` option last.
Any positional arguments after `-x` belong to the command template, not to `fd` itself. If you
also want to pass a pattern or search path, put `-x` last:
``` bash
fd pattern path -x echo
```
Find all `test_*.py` files and open them in your favorite editor:
``` bash
fd -g 'test_*.py' -X vim
```
Note that we use capital `-X` here to open a single `vim` instance. If there are two such files,
`test_basic.py` and `lib/test_advanced.py`, this will run `vim test_basic.py lib/test_advanced.py`.
To see details like file permissions, owners, file sizes etc., you can tell `fd` to show them
by running `ls` for each result:
``` bash
fd … -X ls -lhd --color=always
```
This pattern is so useful that `fd` provides a shortcut. You can use the `-l`/`--list-details`
option to execute `ls` in this way: `fd … -l`.
The `-X` option is also useful when combining `fd` with [ripgrep](https://github.com/BurntSushi/ripgrep/) (`rg`) in order to search within a certain class of files, like all C++ source files:
```bash
fd -e cpp -e cxx -e h -e hpp -X rg 'std::cout'
```
Convert all `*.jpg` files to `*.png` files:
``` bash
fd -e jpg -x convert {} {.}.png
```
Here, `{}` is a placeholder for the search result. `{.}` is the same, without the file extension.
See below for more details on the placeholder syntax.
The terminal output of commands run from parallel threads using `-x` will not be interlaced or garbled,
so `fd -x` can be used to rudimentarily parallelize a task run over many files.
An example of this is calculating the checksum of each individual file within a directory.
``` bash
fd -tf -x md5sum > file_checksums.txt
```
#### Placeholder syntax
The `-x` and `-X` options take a *command template* as a series of arguments (instead of a single string).
If you want to add additional options to `fd` after the command template, you can terminate it with a `\;`.
For example, `fd -x echo \; pattern path` treats `pattern path` as `fd` arguments instead of
passing them to `echo`. In practice, it is often clearer to write `fd pattern path -x echo`.
The syntax for generating commands is similar to that of [GNU Parallel](https://www.gnu.org/software/parallel/):
- `{}`: A placeholder token that will be replaced with the path of the search result
(`documents/images/party.jpg`).
- `{.}`: Like `{}`, but without the file extension (`documents/images/party`).
- `{/}`: A placeholder that will be replaced by the basename of the search result (`party.jpg`).
- `{//}`: The parent of the discovered path (`documents/images`).
- `{/.}`: The basename, with the extension removed (`party`).
If you do not include a placeholder, *fd* automatically adds a `{}` at the end.
#### Parallel vs. serial execution
For `-x`/`--exec`, you can control the number of parallel jobs by using the `-j`/`--threads` option.
Use `--threads=1` for serial execution.
### Excluding specific files or directories
Sometimes we want to ignore search results from a specific subdirectory. For example, we might
want to search all hidden files and directories (`-H`) but exclude all matches from `.git`
directories. We can use the `-E` (or `--exclude`) option for this. It takes an arbitrary glob
pattern as an argument:
``` bash
> fd -H -E .git …
```
We can also use this to skip mounted directories:
``` bash
> fd -E /mnt/external-drive …
```
.. or to skip certain file types:
``` bash
> fd -E '*.bak' …
```
To make exclude-patterns like these permanent, you can create a `.fdignore` file. They work like
`.gitignore` files, but are specific to `fd`. For example:
``` bash
> cat ~/.fdignore
/mnt/external-drive
*.bak
```
> [!NOTE]
> `fd` also supports `.ignore` files that are used by other programs such as `rg` or `ag`.
If you want `fd` to ignore these patterns globally, you can put them in `fd`'s global ignore file.
This is usually located in `~/.config/fd/ignore` in macOS or Linux, and `%APPDATA%\fd\ignore` in
Windows.
You may wish to include `.git/` in your `fd/ignore` file so that `.git` directories, and their contents
are not included in output if you use the `--hidden` option.
### Deleting files
You can use `fd` to remove all files and directories that are matched by your search pattern.
If you only want to remove files, you can use the `--exec-batch`/`-X` option to call `rm`. For
example, to recursively remove all `.DS_Store` files, run:
``` bash
> fd -H '^\.DS_Store$' -tf -X rm
```
If you are unsure, always call `fd` without `-X rm` first. Alternatively, use `rm`s "interactive"
option:
``` bash
> fd -H '^\.DS_Store$' -tf -X rm -i
```
If you also want to remove a certain class of directories, you can use the same technique. You will
have to use `rm`s `--recursive`/`-r` flag to remove directories.
> [!NOTE]
> There are scenarios where using `fd … -X rm -r` can cause race conditions: if you have a
path like `…/foo/bar/foo/…` and want to remove all directories named `foo`, you can end up in a
situation where the outer `foo` directory is removed first, leading to (harmless) *"'foo/bar/foo':
No such file or directory"* errors in the `rm` call.
### Command-line options
This is the output of `fd -h`. To see the full set of command-line options, use `fd --help` which
also includes a much more detailed help text.
```
Usage: fd [OPTIONS] [pattern [path]...]
Arguments:
[pattern] the search pattern (a regular expression, unless '--glob' is used; optional)
[path]... the root directories for the filesystem search (optional)
Options:
-H, --hidden Search hidden files and directories
-I, --no-ignore Do not respect .(git|fd)ignore files
-s, --case-sensitive Case-sensitive search (default: smart case)
-i, --ignore-case Case-insensitive search (default: smart case)
-g, --glob Glob-based search (default: regular expression)
-a, --absolute-path Show absolute instead of relative paths
-l, --list-details Use a long listing format with file metadata
-L, --follow Follow symbolic links
-p, --full-path Search full abs. path (default: filename only)
-d, --max-depth <depth> Set maximum search depth (default: none)
-E, --exclude <glob> Exclude entries that match the given glob pattern
-t, --type <filetype> Filter by type: file (f), directory (d/dir), symlink (l),
executable (x), empty (e), socket (s), pipe (p), char-device
(c), block-device (b)
-e, --extension <ext> Filter by extension
-S, --size <size> Limit results based on the size of files
--changed-within <date|dur> Filter by file modification time (newer than)
--changed-before <date|dur> Filter by file modification time (older than)
-o, --owner <user:group> Filter by owning user and/or group
--format <fmt> Print results according to template
-x, --exec <cmd>... Execute a command for each search result
-X, --exec-batch <cmd>... Execute a command with all search results at once
-c, --color <when> When to use colors [default: auto] [possible values: auto,
always, never]
--hyperlink[=<when>] Add hyperlinks to output paths [default: never] [possible
values: auto, always, never]
--ignore-contain <name> Ignore directories containing the named entry
-h, --help Print help (see more with '--help')
-V, --version Print version
```
Note that options can be given after the pattern and/or path as well.
## Benchmark
Let's search my home folder for files that end in `[0-9].jpg`. It contains ~150.000
subdirectories and about a million files. For averaging and statistical analysis, I'm using
[bench](https://github.com/Gabriel439/bench). All benchmarks are performed for a "warm
cache". Results for a cold cache are similar.
Let's search my home folder for files that end in `[0-9].jpg`. It contains ~750,000
subdirectories and about a 4 million files. For averaging and statistical analysis, I'm using
[hyperfine](https://github.com/sharkdp/hyperfine). The following benchmarks are performed
with a "warm"/pre-filled disk-cache (results for a "cold" disk-cache show the same trends).
Let's start with `find`:
```
find ~ -iregex '.*[0-9]\.jpg$'
time 6.265 s (6.127 s .. NaN s)
1.000 R² (1.000 R² .. 1.000 R²)
mean 6.162 s (6.140 s .. 6.181 s)
std dev 31.73 ms (0.0 s .. 33.48 ms)
Benchmark 1: find ~ -iregex '.*[0-9]\.jpg$'
Time (mean ± σ): 19.922 s ± 0.109 s
Range (min … max): 19.765 s … 20.065 s
```
`find` is much faster if it does not need to perform a regular-expression search:
```
find ~ -iname '*[0-9].jpg'
time 2.866 s (2.754 s .. 2.964 s)
1.000 R² (0.999 R² .. 1.000 R²)
mean 2.860 s (2.834 s .. 2.875 s)
std dev 23.11 ms (0.0 s .. 25.09 ms)
Benchmark 2: find ~ -iname '*[0-9].jpg'
Time (mean ± σ): 11.226 s ± 0.104 s
Range (min … max): 11.119 s … 11.466 s
```
Now let's try the same for `fd`. Note that `fd` *always* performs a regular expression
search. The options `--hidden` and `--no-ignore` are needed for a fair comparison,
otherwise `fd` does not have to traverse hidden folders and ignored paths (see below):
Now let's try the same for `fd`. Note that `fd` performs a regular expression
search by default. The options `-u`/`--unrestricted` option is needed here for
a fair comparison. Otherwise `fd` does not have to traverse hidden folders and
ignored paths (see below):
```
fd --hidden --no-ignore '.*[0-9]\.jpg$' ~
time 892.6 ms (839.0 ms .. 915.4 ms)
0.999 R² (0.997 R² .. 1.000 R²)
mean 871.2 ms (857.9 ms .. 881.3 ms)
std dev 15.50 ms (0.0 s .. 17.49 ms)
Benchmark 3: fd -u '[0-9]\.jpg$' ~
Time (mean ± σ): 854.8 ms ± 10.0 ms
Range (min … max): 839.2 ms … 868.9 ms
```
For this particular example, `fd` is approximately seven times faster than `find -iregex`
and about three times faster than `find -iname`. By the way, both tools found the exact
same 14030 files :smile:.
For this particular example, `fd` is approximately **23 times faster** than `find -iregex`
and about **13 times faster** than `find -iname`. By the way, both tools found the exact
same 546 files :smile:.
Finally, let's run `fd` without `--hidden` and `--no-ignore` (this can lead to different
search results, of course):
```
fd '[0-9]\.jpg$' ~
**Note**: This is *one particular* benchmark on *one particular* machine. While we have
performed a lot of different tests (and found consistent results), things might
be different for you! We encourage everyone to try it out on their own. See
[this repository](https://github.com/sharkdp/fd-benchmarks) for all necessary scripts.
time 159.5 ms (155.8 ms .. 165.3 ms)
0.999 R² (0.996 R² .. 1.000 R²)
mean 158.7 ms (156.5 ms .. 161.6 ms)
std dev 3.263 ms (2.401 ms .. 4.298 ms)
Concerning *fd*'s speed, a lot of credit goes to the `regex` and `ignore` crates that are
also used in [ripgrep](https://github.com/BurntSushi/ripgrep) (check it out!).
## Troubleshooting
### `fd` does not find my file!
Remember that `fd` ignores hidden directories and files by default. It also ignores patterns
from `.gitignore` files. If you want to make sure to find absolutely every possible file, always
use the options `-u`/`--unrestricted` option (or `-HI` to enable hidden and ignored files):
``` bash
> fd -u …
```
**Note**: This is *one particular* benchmark on *one particular* machine. While I have
performed quite a lot of different tests (and found consistent results), things might
be different for you! I encourage everyone to try it out on their own.
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.
Concerning *fd*'s speed, the main credit goes to the `regex` and `ignore` crates that are also used
in [ripgrep](https://github.com/BurntSushi/ripgrep) (check it out!).
### Colorized output
## Install
With Rust's package manager [cargo](https://github.com/rust-lang/cargo), you can install *fd* via:
`fd` can colorize files by extension, just like `ls`. In order for this to work, the environment
variable [`LS_COLORS`](https://linux.die.net/man/5/dir_colors) has to be set. Typically, the value
of this variable is set by the `dircolors` command which provides a convenient configuration format
to define colors for different file formats.
On most distributions, `LS_COLORS` should be set already. If you are on Windows or if you are looking
for alternative, more complete (or more colorful) variants, see [here](https://github.com/sharkdp/vivid),
[here](https://github.com/seebi/dircolors-solarized) or
[here](https://github.com/trapd00r/LS_COLORS).
`fd` also honors the [`NO_COLOR`](https://no-color.org/) environment variable.
### `fd` doesn't seem to interpret my regex pattern correctly
A lot of special regex characters (like `[]`, `^`, `$`, ..) are also special characters in your
shell. If in doubt, always make sure to put single quotes around the regex pattern:
``` bash
> fd '^[A-Z][0-9]+$'
```
cargo install fd-find
```
Note that rust version *1.16.0* or later is required.
The release page of this repository also includes precompiled binaries for Linux.
On **macOS**, you can use [Homebrew](http://braumeister.org/formula/fd):
If your pattern starts with a dash, you have to add `--` to signal the end of command line
options. Otherwise, the pattern will be interpreted as a command-line option. Alternatively,
use a character class with a single hyphen character:
``` bash
> fd -- '-pattern'
> fd '[-]pattern'
```
### "Command not found" for `alias`es or shell functions
Shell `alias`es and shell functions can not be used for command execution via `fd -x` or
`fd -X`. In `zsh`, you can make the alias global via `alias -g myalias="…"`. In `bash`,
you can use `export -f my_function` to make available to child processes. You would still
need to call `fd -x bash -c 'my_function "$1"' bash`. For other use cases or shells, use
a (temporary) shell script.
### Placeholders in `-x`/`-X`
Depending on your shell, you may need to quote the placeholders (`{}`, `{/}`, `{//}`,
`{.}`, `{/.}`) to prevent the shell from interpreting them before `fd` sees them.
## Integration with other programs
### Using fd with `fzf`
You can use *fd* to generate input for the command-line fuzzy finder [fzf](https://github.com/junegunn/fzf):
``` bash
export FZF_DEFAULT_COMMAND='fd --type file'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
```
Then, you can type `vim <Ctrl-T>` on your terminal to open fzf and search through the fd-results.
Alternatively, you might like to follow symbolic links and include hidden files (but exclude `.git` folders):
``` bash
export FZF_DEFAULT_COMMAND='fd --type file --follow --hidden --exclude .git'
```
You can even use fd's colored output inside fzf by setting:
``` bash
export FZF_DEFAULT_COMMAND="fd --type file --color=always"
export FZF_DEFAULT_OPTS="--ansi"
```
For more details, see the [Tips section](https://github.com/junegunn/fzf#tips) of the fzf README.
### Using fd with `rofi`
[*rofi*](https://github.com/davatorium/rofi) is a graphical launch menu application that is able to create menus by reading from *stdin*. Piping `fd` output into `rofi`s `-dmenu` mode creates fuzzy-searchable lists of files and directories.
#### Example
Create a case-insensitive searchable multi-select list of *PDF* files under your `$HOME` directory and open the selection with your configured PDF viewer. To list all file types, drop the `-e pdf` argument.
``` bash
fd --type f -e pdf . $HOME | rofi -keep-right -dmenu -i -p FILES -multi-select | xargs -I {} xdg-open {}
```
To modify the list that is presented by rofi, add arguments to the `fd` command. To modify the search behaviour of rofi, add arguments to the `rofi` command.
### Using fd with `emacs`
The emacs package [find-file-in-project](https://github.com/technomancy/find-file-in-project) can
use *fd* to find files.
After installing `find-file-in-project`, add the line `(setq ffip-use-rust-fd t)` to your
`~/.emacs` or `~/.emacs.d/init.el` file.
In emacs, run `M-x find-file-in-project-by-selected` to find matching files. Alternatively, run
`M-x find-file-in-project` to list all available files in the project.
### Printing the output as a tree
To format the output of `fd` as a file-tree you can use the `tree` command with
`--fromfile`:
```bash
fd | tree --fromfile
```
This can be more useful than running `tree` by itself because `tree` does not
ignore any files by default, nor does it support as rich a set of options as
`fd` does to control what to print:
```bash
fd --extension rs | tree --fromfile
.
├── build.rs
└── src
├── app.rs
└── error.rs
```
On bash and similar you can simply create an alias:
```bash
alias as-tree='tree --fromfile'
```
### Using fd with `xargs` or `parallel`
Note that `fd` has a builtin feature for [command execution](#command-execution) with
its `-x`/`--exec` and `-X`/`--exec-batch` options. If you prefer, you can still use
it in combination with `xargs`:
``` bash
> fd -0 -e rs | xargs -0 wc -l
```
Here, the `-0` option tells *fd* to separate search results by the NULL character (instead of
newlines). In the same way, the `-0` option of `xargs` tells it to read the input in this way.
## Installation
[![Packaging status](https://repology.org/badge/vertical-allrepos/fd-find.svg)](https://repology.org/project/fd-find/versions)
### On Ubuntu
*... and other Debian-based Linux distributions.*
If you run Ubuntu 19.04 (Disco Dingo) or newer, you can install the
[officially maintained package](https://packages.ubuntu.com/fd-find):
```
apt install fd-find
```
Note that the binary is called `fdfind` as the binary name `fd` is already used by another package.
It is recommended that after installation, you add a link to `fd` by executing command
`ln -s $(which fdfind) ~/.local/bin/fd`, in order to use `fd` in the same way as in this documentation.
Make sure that `$HOME/.local/bin` is in your `$PATH`.
If you use an older version of Ubuntu, you can download the latest `.deb` package from the
[release page](https://github.com/sharkdp/fd/releases) and install it via:
``` bash
dpkg -i fd_9.0.0_amd64.deb # adapt version number and architecture
```
Note that the .deb packages on the release page for this project still name the executable `fd`.
### On Debian
If you run Debian Buster or newer, you can install the
[officially maintained Debian package](https://tracker.debian.org/pkg/rust-fd-find):
```
apt-get install fd-find
```
Note that the binary is called `fdfind` as the binary name `fd` is already used by another package.
It is recommended that after installation, you add a link to `fd` by executing command
`ln -s $(which fdfind) ~/.local/bin/fd`, in order to use `fd` in the same way as in this documentation.
Make sure that `$HOME/.local/bin` is in your `$PATH`.
Note that the .deb packages on the release page for this project still name the executable `fd`.
### On Fedora
Starting with Fedora 28, you can install `fd` from the official package sources:
``` bash
dnf install fd-find
```
### On Alpine Linux
You can install [the fd package](https://pkgs.alpinelinux.org/packages?name=fd)
from the official sources, provided you have the appropriate repository enabled:
```
apk add fd
```
### On Arch Linux
You can install [the fd package](https://www.archlinux.org/packages/extra/x86_64/fd/) from the official repos:
```
pacman -S fd
```
You can also install fd [from the AUR](https://aur.archlinux.org/packages/fd-git).
### On Gentoo Linux
You can use [the fd ebuild](https://packages.gentoo.org/packages/sys-apps/fd) from the official repo:
```
emerge -av fd
```
### On openSUSE Linux
You can install [the fd package](https://software.opensuse.org/package/fd) from the official repo:
```
zypper in fd
```
### On Void Linux
You can install `fd` via xbps-install:
```
xbps-install -S fd
```
### On ALT Linux
You can install [the fd package](https://packages.altlinux.org/en/sisyphus/srpms/fd/) from the official repo:
```
apt-get install fd
```
### On Solus
You can install [the fd package](https://github.com/getsolus/packages/tree/main/packages/f/fd) from the official repo:
```
eopkg install fd
```
### On RedHat Enterprise Linux (RHEL) 8/9/10, Almalinux 8/9/10, EuroLinux 8/9 or Rocky Linux 8/9/10
You can install [the `fd` package](https://copr.fedorainfracloud.org/coprs/tkbcopr/fd/) from Fedora Copr.
```bash
dnf copr enable tkbcopr/fd
dnf install fd
```
A different version using the [slower](https://github.com/sharkdp/fd/pull/481#issuecomment-534494592) malloc [instead of jemalloc](https://bugzilla.redhat.com/show_bug.cgi?id=2216193#c1) is also available from the EPEL8/9 repo as the package `fd-find`.
### On macOS
You can install `fd` with [Homebrew](https://formulae.brew.sh/formula/fd):
```
brew install fd
```
On **Arch Linux**, you can install the AUR package [fd-rs](https://aur.archlinux.org/packages/fd-rs/) (for the stable version) or [fd-rs-git](https://aur.archlinux.org/packages/fd-rs-git/) (for the current master) via yaourt, or manually:
… or with MacPorts:
```
git clone https://aur.archlinux.org/fd-rs.git
cd fd-rs
makepkg -si
port install fd
```
### On Windows
You can download pre-built binaries from the [release page](https://github.com/sharkdp/fd/releases).
Alternatively, you can install `fd` via [Scoop](http://scoop.sh):
```
scoop install fd
```
Or via [Chocolatey](https://chocolatey.org):
```
choco install fd
```
Or via [Winget](https://learn.microsoft.com/en-us/windows/package-manager/):
```
winget install sharkdp.fd
```
### On GuixOS
You can install [the fd package](https://guix.gnu.org/en/packages/fd-8.1.1/) from the official repo:
```
guix install fd
```
### On Mise
You can use [mise](https://github.com/jdx/mise) to install `fd` with a command like this:
```
mise use -g fd@latest
```
### On NixOS / via Nix
You can use the [Nix package manager](https://nixos.org/nix/) to install `fd`:
```
nix-env -i fd
```
### Via Flox
You can use [Flox](https://flox.dev) to install `fd` into a Flox environment:
```
flox install fd
```
### On FreeBSD
You can install [the fd-find package](https://www.freshports.org/sysutils/fd) from the official repo:
```
pkg install fd-find
```
### From npm
On Linux and macOS, you can install the [fd-find](https://npm.im/fd-find) package:
```
npm install -g fd-find
```
### From source
With Rust's package manager [cargo](https://github.com/rust-lang/cargo), you can install *fd* via:
```
cargo install fd-find
```
Note that rust version *1.90.0* or later is required.
`make` is also needed for the build.
### From binaries
The [release page](https://github.com/sharkdp/fd/releases) includes precompiled binaries for Linux, macOS and Windows. Statically-linked binaries are also available: look for archives with `musl` in the file name.
## Development
```bash
git clone https://github.com/sharkdp/fd
@@ -122,40 +739,52 @@ git clone https://github.com/sharkdp/fd
cd fd
cargo build
# Run unit tests
# Run unit tests and integration tests
cargo test
# Run integration tests
cd tests
bash test.sh
# Install
cargo install
cargo install --path .
```
## Command-line options
### Completions
#### From Release Archives
Pre-built completion files are included in the release archives (`.tar.gz`/`.zip`) on the
[Releases page](https://github.com/sharkdp/fd/releases), in the `autocomplete` directory.
To use these completions:
- **bash**: Source the `fd.bash` file in your `~/.bashrc`, or place it in a directory that gets sourced automatically.
- **zsh**: Move `_fd` to a directory in your `fpath` (e.g., `~/.zfunc`).
- **fish**: Copy `fd.fish` to `~/.config/fish/completions/`.
- **powershell**: Source `_fd.ps1` from one of your [profile scripts](https://learn.microsoft.com/en-us/powershell/scripting/learn/shell/creating-profiles?view=powershell-7.5).
#### Generate from fd
You can also generate completions directly using `fd --gen-completions <shell>`:
```bash
# Bash
fd --gen-completions bash > ~/.local/share/bash-completion/completions/fd
# Zsh (ensure ~/.zfunc is in your fpath)
fd --gen-completions zsh > ~/.zfunc/_fd
# Fish
fd --gen-completions fish > ~/.config/fish/completions/fd.fish
# PowerShell
fd --gen-completions powershell >> $PROFILE
```
USAGE:
fd [FLAGS/OPTIONS] [<pattern>] [<path>]
FLAGS:
-s, --case-sensitive Case-sensitive search (default: smart case)
-p, --full-path Search full path (default: file-/dirname only)
-H, --hidden Search hidden files and directories
-I, --no-ignore Do not respect .(git)ignore files
-L, --follow Follow symlinks
-0, --print0 Separate results by the null character
-a, --absolute-path Show absolute instead of relative paths
-n, --no-color Do not colorize output
-h, --help Prints help information
-V, --version Prints version information
## Maintainers
OPTIONS:
-d, --max-depth <depth> Set maximum search depth (default: none)
-j, --threads <threads> The number of threads used for searching
-t, --type <type> The type of file to search for [values: f, file, d, directory, s, symlink]
- [sharkdp](https://github.com/sharkdp)
- [tmccombs](https://github.com/tmccombs)
- [tavianator](https://github.com/tavianator)
ARGS:
<pattern> the search pattern, a regular expression (optional)
<path> the root directory for the filesystem search (optional)
```
## License
`fd` is distributed under the terms of both the MIT License and the Apache License 2.0.
See the [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) files for license details.
+33
View File
@@ -0,0 +1,33 @@
# Security Reporting
If you wish to report a security vulnerability privately, we appreciate your diligence. Please follow the guidelines below to submit your report.
## Reporting
To report a security vulnerability, please provide the following information:
1. **PROJECT**
- Include the URL of the project repository - Example: <https://github.com/sharkdp/fd>
2. **PUBLIC**
- Indicate whether this vulnerability has already been publicly discussed or disclosed.
- If so, provide relevant links.
3. **DESCRIPTION**
- Provide a detailed description of the security vulnerability.
- Include as much information as possible to help us understand and address the issue.
Send this information, along with any additional relevant details, to our [vulnerability reporting form](https://github.com/sharkdp/fd/security/advisories/new).
## Confidentiality
We kindly ask you to keep the report confidential until a public announcement is made.
## Notes
- Vulnerabilities will be handled on a best-effort basis.
- You may request an advance copy of the patched release, but we cannot guarantee early access before the public release.
- You will be notified via email simultaneously with the public announcement.
- We will respond within a few weeks to confirm whether your report has been accepted or rejected.
Thank you for helping to improve the security of our project!
+285
View File
@@ -0,0 +1,285 @@
#compdef fd
##
# zsh completion function for fd
#
# Based on ripgrep completion function.
# Originally based on code from the zsh-users project — see copyright notice
# below.
autoload -U is-at-least
_fd() {
local curcontext="$curcontext" no='!' ret=1
local -a context line state state_descr _arguments_options fd_types fd_args
local -A opt_args
if is-at-least 5.2; then
_arguments_options=( -s -S )
else
_arguments_options=( -s )
fi
fd_types=(
{f,file}'\:"regular files"'
{d,directory}'\:"directories"'
{l,symlink}'\:"symbolic links"'
{e,empty}'\:"empty files or directories"'
{x,executable}'\:"executable (files)"'
{b,block-device}'\:"block devices"'
{c,char-device}'\:"character devices"'
{s,socket}'\:"sockets"'
{p,pipe}'\:"named pipes (FIFOs)"'
)
# Do not complete rare options unless either the current prefix
# matches one of those options or the user has the `complete-all`
# style set. Note that this prefix check has to be updated manually to account
# for all of the potential negation options listed below!
if
# (--[bpsu]* => match all options marked with '$no')
[[ $PREFIX$SUFFIX == --[bopsun]* ]] ||
zstyle -t ":complete:$curcontext:*" complete-all
then
no=
fi
# We make heavy use of argument groups here to prevent the option specs from
# growing unwieldy. These aren't supported in zsh <5.4, though, so we'll strip
# them out below if necessary. This makes the exclusions inaccurate on those
# older versions, but oh well — it's not that big a deal
fd_args=(
+ '(hidden)' # hidden files
{-H,--hidden}'[search hidden files/directories]'
+ '(no-ignore-full)' # all ignore files
'(no-ignore-partial)'{-I,--no-ignore}"[don't respect .(git|fd)ignore and global ignore files]"
$no'(no-ignore-partial)*'{-u,--unrestricted}'[alias for --no-ignore, when repeated also alias for --hidden]'
+ no-ignore-partial # some ignore files
"(no-ignore-full --no-ignore-vcs)--no-ignore-vcs[don't respect .gitignore files]"
"!(no-ignore-full --no-global-ignore-file)--no-global-ignore-file[don't respect the global ignore file]"
$no'(no-ignore-full --no-ignore-parent)--no-ignore-parent[]'
+ '(case)' # case-sensitivity
{-s,--case-sensitive}'[perform a case-sensitive search]'
{-i,--ignore-case}'[perform a case-insensitive search]'
+ '(regex-pattern)' # regex-based search pattern
'(no-regex-pattern)--regex[perform a regex-based search (default)]'
+ '(no-regex-pattern)' # non-regex-based search pattern
{-g,--glob}'[perform a glob-based search]'
{-F,--fixed-strings}'[treat pattern as literal string instead of a regex]'
+ '(no-require-git)'
"$no(no-ignore-full --no-ignore-vcs --no-require-git)--no-require-git[don't require git repo to respect gitignores]"
+ '(match-full)' # match against full path
{-p,--full-path}'[match the pattern against the full path instead of the basename]'
+ '(follow)' # follow symlinks
{-L,--follow}'[follow symbolic links to directories]'
+ '(abs-path)' # show absolute paths
'(long-listing)'{-a,--absolute-path}'[show absolute paths instead of relative paths]'
+ '(null-sep)' # use null separator for output
'(long-listing)'{-0,--print0}'[separate search results by the null character]'
+ '(long-listing)' # long-listing output
'(abs-path null-sep max-results exec-cmds)'{-l,--list-details}'[use a long listing format with file metadata]'
+ '(max-results)' # max number of results
'(long-listing exec-cmds)--max-results=[limit number of search results to given count and quit]:count'
'(long-listing exec-cmds)-1[limit to a single search result and quit]'
+ '(fs-errors)' # file-system errors
$no'--show-errors[enable the display of filesystem errors]'
+ '(fs-traversal)' # file-system traversal
$no"--one-file-system[don't descend into directories on other file systems]"
'!--mount'
'!--xdev'
+ dir-depth # directory depth
'(--exact-depth -d --max-depth)'{-d+,--max-depth=}'[set max directory depth to descend when searching]:depth'
'!(--exact-depth -d --max-depth)--maxdepth:depth'
'(--exact-depth --min-depth)--min-depth=[set directory depth to descend before start searching]:depth'
'(--exact-depth -d --max-depth --maxdepth --min-depth)--exact-depth=[only search at the exact given directory depth]:depth'
+ prune # pruning
"--prune[don't traverse into matching directories]"
+ filter-misc # filter search
'*'{-t+,--type=}"[filter search by type]:type:(($fd_types))"
'*'{-e+,--extension=}'[filter search by file extension]:extension'
'*'{-E+,--exclude=}'[exclude files/directories that match the given glob pattern]:glob pattern'
'*'{-S+,--size=}'[limit search by file size]:size limit:->size'
'(-o --owner)'{-o+,--owner=}'[filter by owning user and/or group]:owner and/or group:->owner'
+ ignore-file # extra ignore files
'*--ignore-file=[add a custom, low-precedence ignore-file with .gitignore format]: :_files'
+ '(filter-mtime-newer)' # filter by files modified after than
'--changed-within=[limit search to files/directories modified within the given date/duration]:date or duration'
'--changed-after=[alias for --changed-within]:date/duration'
'!--change-newer-than=:date/duration'
'!--newer=:date/duration'
+ '(filter-mtime-older)' # filter by files modified before than
'--changed-before=[limit search to files/directories modified before the given date/duration]:date or duration'
'!--change-older-than=:date/duration'
'!--older=:date/duration'
+ '(color)' # colorize output
{-c+,--color=}'[declare when to colorize search results]:when to colorize:((
auto\:"show colors if the output goes to an interactive console (default)"
never\:"do not use colorized output"
always\:"always use colorized output"
))'
'--hyperlink=-[add hyperlinks to output paths]::when:(auto never always)'
+ '(threads)'
{-j+,--threads=}'[set the number of threads for searching and executing]:number of threads'
+ '(exec-cmds)' # execute command
'(long-listing max-results)'{-x+,--exec=}'[execute command for each search result]:command: _command_names -e:*\;::program arguments: _normal'
'(long-listing max-results)'{-X+,--exec-batch=}'[execute command for all search results at once]:command: _command_names -e:*\;::program arguments: _normal'
'(long-listing max-results)--batch-size=[max number of args for each -X call]:size'
+ other
'!(--max-buffer-time)--max-buffer-time=[set amount of time to buffer before showing output]:time (ms)'
+ '(about)' # about flags
'(: * -)'{-h,--help}'[display help message]'
'(: * -)'{-V,--version}'[display version information]'
+ path-sep # set path separator for output
$no'(--path-separator)--path-separator=[set the path separator to use when printing file paths]:path separator'
+ search-path
$no'(--base-directory)--base-directory=[change the current working directory to the given path]:directory:_files -/'
$no'(*)*--search-path=[set search path (instead of positional <path> arguments)]:directory:_files -/'
+ strip-cwd-prefix
$no'(strip-cwd-prefix exec-cmds)--strip-cwd-prefix=-[When to strip ./]::when:(always never auto)'
+ and
'--and=[additional required search path]:pattern'
+ args # positional arguments
'1: :_guard "^-*" pattern'
'(--search-path)*:directory:_files -/'
)
# Strip out argument groups where unsupported (see above)
is-at-least 5.4 ||
fd_args=( ${(@)args:#(#i)(+|[a-z0-9][a-z0-9_-]#|\([a-z0-9][a-z0-9_-]#\))} )
_arguments $_arguments_options : $fd_args && ret=0
case ${state} in
owner)
compset -P '(\\|)\!'
if compset -P '*:'; then
_groups && ret=0
else
if
compset -S ':*' ||
# Do not add the colon suffix when completing "!user<TAB>
# (with a starting double-quote) otherwise pressing tab again
# after the inserted colon "!user:<TAB> will complete history modifiers
[[ $IPREFIX == (\\|\!)* && ($QIPREFIX == \"* && -z $QISUFFIX) ]]
then
_users && ret=0
else
local q
# Since quotes are needed when using the negation prefix !,
# automatically remove the colon suffix also when closing the quote
if [[ $QIPREFIX == [\'\"]* ]]; then
q=${QIPREFIX:0:1}
fi
_users -r ": \t\n\-$q" -S : && ret=0
fi
fi
;;
size)
if compset -P '[-+][0-9]##'; then
local -a suff=(
'B:bytes'
'K:kilobytes (10^3 = 1000 bytes)'
'M:megabytes (10^6 = 1000^2 bytes)'
'G:gigabytes (10^9 = 1000^3 bytes)'
'T:terabytes (10^12 = 1000^4 bytes)'
'Ki:kibibytes ( 2^10 = 1024 bytes)'
'Mi:mebibytes ( 2^20 = 1024^2 bytes)'
'Gi:gigibytes ( 2^30 = 1024^3 bytes)'
'Ti:tebibytes ( 2^40 = 1024^4 bytes)'
)
_describe -t units 'size limit units' suff -V 'units'
elif compset -P '[-+]'; then
_message -e 'size limit number (full format: <+-><number><unit>)'
else
_values 'size limit prefix (full format: <prefix><number><unit>)' \
'\+[file size must be greater or equal to]'\
'-[file size must be less than or equal to]' && ret=0
fi
;;
esac
return ret
}
_fd "$@"
# ------------------------------------------------------------------------------
# Copyright (c) 2011 GitHub zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for fd
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * smancill (https://github.com/smancill)
#
# ------------------------------------------------------------------------------
# Local Variables:
# mode: shell-script
# coding: utf-8-unix
# indent-tabs-mode: nil
# sh-indentation: 2
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et
+2
View File
@@ -0,0 +1,2 @@
#compdef fdfind
_fd "$@"
+8
View File
@@ -0,0 +1,8 @@
# Source fd completions
source /usr/share/bash-completion/completions/fd
if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then
complete -F _fd -o nosort -o bashdefault -o default fdfind
else
complete -F _fd -o bashdefault -o default fdfind
fi
+1
View File
@@ -0,0 +1 @@
complete -c fdfind --wraps fd
+1
View File
@@ -0,0 +1 @@
* linguist-vendored
Vendored
+587
View File
@@ -0,0 +1,587 @@
.TH FD 1
.SH NAME
fd \- find entries in the filesystem
.SH SYNOPSIS
.B fd
.RB [ \-HIEsiaLp0hV ]
.RB [ \-d
.IR depth ]
.RB [ \-t
.IR filetype ]
.RB [ \-e
.IR ext ]
.RB [ \-E
.IR exclude ]
.RB [ \-c
.IR when ]
.RB [ \-j
.IR num ]
.RB [ \-x
.IR cmd ]
.RI [ pattern
.RI [ path... ]]
.SH DESCRIPTION
.B fd
is a simple, fast and user-friendly alternative to
.BR find (1).
.P
By default
.B fd
uses regular expressions for the pattern. However, this can be changed to use simple glob patterns
with the '\-\-glob' option.
.P
By default
.B fd
will exclude hidden files and directories, as well as any files that match gitignore rules
or ignore rules in .ignore or .fdignore files.
.P
If you wish to search all files in a specific directory, you can use '' or . as the search pattern,
to match all files. Or you can use the '\-\-search\-path' option to specify the path(s) instead of
the positional parameter.
.P
Options may be given anywhere on the command line.
.SH OPTIONS
.TP
.B \-H, \-\-hidden
Include hidden files and directories in the search results
(default: hidden files and directories are skipped). The flag can be overridden with '--no-hidden'.
.IP
Ignored files are still excluded unless \-\-no\-ignore or \-\-no\-ignore\-vcs
is also used.
.TP
.B \-I, \-\-no\-ignore
Show search results from files and directories that would otherwise be ignored by
.RS
.IP \[bu] 2
.I .gitignore
.IP \[bu]
.I .git/info/exclude
.IP \[bu]
The global gitignore configuration (by default
.IR $HOME/.config/git/ignore )
.IP \[bu]
.I .ignore
.IP \[bu]
.I .fdignore
.IP \[bu]
The global fd ignore file (usually
.I $HOME/.config/fd/ignore
)
.RE
.IP
The flag can be overridden with '--ignore'.
.TP
.B \-u, \-\-unrestricted
Perform an unrestricted search, including ignored and hidden files. This is an alias for '--hidden --no-ignore'.
.TP
.B \-\-no\-ignore\-vcs
Show search results from files and directories that would otherwise be ignored by gitignore files
including
.IR .gitignore ,
.IR .git/info/exclude ,
and the global gitignore configuration
.RI ( core.excludesFile
git setting, which defaults to
.IR $HOME/.config/git/ignore ).
The flag can be overridden with '--ignore-vcs'.
.TP
.B \-\-no\-require\-git
Do not require a git repository to respect gitignores. By default, fd will only
respect global gitignore rules, .gitignore rules and local exclude rules if fd
detects that you are searching inside a git repository. This flag allows you to
relax this restriction such that fd will respect all git related ignore rules
regardless of whether youre searching in a git repository or not. The flag can
be overridden with '--require-git'.
.TP
.B \-\-no\-ignore\-parent
Show search results from files and directories that would otherwise be ignored by gitignore files in
parent directories.
.TP
.B \-s, \-\-case\-sensitive
Perform a case-sensitive search. By default, fd uses case-insensitive searches, unless the
pattern contains an uppercase character (smart case).
.TP
.B \-i, \-\-ignore\-case
Perform a case-insensitive search. By default, fd uses case-insensitive searches, unless the
pattern contains an uppercase character (smart case).
.TP
.B \-g, \-\-glob
Perform a glob-based search instead of a regular expression search.
If combined with the '\-\-full-path' option, '**' can be used to match multiple path components.
.TP
.B \-\-regex
Perform a regular-expression based search (default). This can be used to override --glob.
.TP
.B \-F, \-\-fixed\-strings
Treat the pattern as a literal string instead of a regular expression. Note that this also
performs substring comparison. If you want to match on an exact filename, consider using '\-\-glob'
or '\-\-exact'.
.TP
.B \-\-exact
Perform an exact match. This is equivalent to '\-\-fixed\-strings' but requires the pattern to
match the entire filename (or the full path if '\-\-full\-path' is used), rather than a substring.
Special regex characters in the pattern are treated as literal characters.
Cannot be used together with '\-\-glob' or '\-\-fixed\-strings'.
.TP
.BI "\-\-and " pattern
Add additional required search patterns, all of which must be matched. Multiple additional
patterns can be specified. The patterns are regular expressions, unless '\-\-glob'
or '\-\-fixed\-strings' is used.
.TP
.B \-a, \-\-absolute\-path
Shows the full path starting from the root as opposed to relative paths.
The flag can be overridden with '--relative-path'.
.TP
.B \-l, \-\-list\-details
Use a detailed listing format like 'ls -l'. This is basically an alias
for '--exec-batch ls -l' with some additional 'ls' options. This can be used
to see more metadata, to show symlink targets and to achieve a deterministic
sort order.
.TP
.B \-L, \-\-follow
By default, fd does not descend into symlinked directories. Using this flag, symbolic links are
also traversed. The flag can be overridden with '--no-follow'.
.TP
.B \-p, \-\-full\-path
By default, the search pattern is only matched against the filename (or directory name). Using
this flag, the
.I pattern
is matched against the full path.
.TP
.B \-0, \-\-print0
Separate search results by the null character (instead of newlines). Useful for piping results to
.IR xargs .
.TP
.B \-\-max\-results count
Limit the number of search results to 'count' and quit immediately.
.TP
.B \-1
Limit the search to a single result and quit immediately. This is an alias for '--max-results=1'.
.TP
.B \-q, \-\-quiet
When the flag is present, the program does not print anything and will instead exit with a code of 0 if there is at least one search result.
Otherwise, the exit code will be 1.
This is mainly for usage in scripts and can be faster than checking for output because the search can be stopped early after the first match.
.B \-\-has\-results
can be used as an alias.
.TP
.B \-\-show-errors
Enable the display of filesystem errors for situations such as insufficient
permissions or dead symlinks.
.TP
.B \-\-strip-cwd-prefix [when]
By default, relative paths are prefixed with './' when -x/--exec,
-X/--exec-batch, or -0/--print0 are given, to reduce the risk of a
path starting with '-' being treated as a command line option. Use
this flag to change this behavior. If this flag is used without a value,
it is equivalent to passing "always". Possible values are:
.RS
.IP never
Never strip the ./ at the beginning of paths
.IP always
Always strip the ./ at the beginning of paths
.IP auto
Only strip if used with --exec, --exec-batch, or --print0. That is, it resets to the default behavior.
.RE
.TP
.B \-\-one\-file\-system, \-\-mount, \-\-xdev
By default, fd will traverse the file system tree as far as other options dictate. With this flag, fd ensures that it does not descend into a different file system than the one it started in. Comparable to the -mount or -xdev filters of find(1).
.TP
.B \-h, \-\-help
Print help information.
.TP
.B \-V, \-\-version
Print version information.
.TP
.BI "\-d, \-\-max\-depth " d
Limit directory traversal to at most
.I d
levels of depth. By default, there is no limit on the search depth.
.TP
.BI "\-\-min\-depth " d
Only show search results starting at the given depth. See also: '--max-depth' and '--exact-depth'.
.TP
.BI "\-\-exact\-depth " d
Only show search results at the exact given depth. This is an alias for '--min-depth <depth> --max-depth <depth>'.
.TP
.B \-\-prune
Do not traverse into matching directories.
.TP
.BI "\-t, \-\-type " filetype
Filter search by type:
.RS
.IP "f, file"
regular files
.IP "d, dir, directory"
directories
.IP "l, symlink"
symbolic links
.IP "b, block-device"
block devices
.IP "c, char-device"
character devices
.IP "s, socket"
sockets
.IP "p, pipe"
named pipes (FIFOs)
.IP "x, executable"
executable (files)
.IP "e, empty"
empty files or directories
.RE
.RS
This option can be specified more than once to include multiple file types.
Searching for '--type file --type symlink' will show both regular files as well as
symlinks. Note that the 'executable' and 'empty' filters work differently: '--type
executable' implies '--type file' by default. And '--type empty' searches for
empty files and directories, unless either '--type file' or '--type directory' is
specified in addition.
Examples:
- Only search for files:
fd --type file …
fd -tf …
- Find both files and symlinks
fd --type file --type symlink …
fd -tf -tl …
- Find executable files:
fd --type executable
fd -tx
- Find empty files:
fd --type empty --type file
fd -te -tf
- Find empty directories:
fd --type empty --type directory
fd -te -td
.RE
.TP
.BI "\-e, \-\-extension " ext
Filter search results by extension
.IR ext .
This option can be used repeatedly to allow for multiple possible extensions.
By default, extension filters apply to both files and directories. Use
\fB\-\-type\fR to restrict the search to specific types.
If you want to search for files without extension, you can use the regex '^[^.]+$'
as a normal search pattern.
.TP
.BI "\-E, \-\-exclude " glob
Exclude files/directories that match the given glob pattern.
This overrides any other ignore logic.
Multiple exclude patterns can be specified.
Examples:
\-\-exclude '*.pyc'
\-\-exclude node_modules
.TP
.BI "\-\-ignore-contain " name
Exclude directories that (directly) contain the given name.
This option can be specified multiple times.
.TP
.BI "\-\-ignore-file " path
Add a custom ignore-file in '.gitignore' format.
These files have a low precedence.
.TP
.BI "\-c, \-\-color " when
Declare
.I when
to colorize search results:
.RS
.IP auto
Colorize output when standard output is connected to terminal (default).
.IP never
Do not colorize output.
.IP always
Always colorize output.
.RE
.TP
.B "\-\-hyperlink
Specify whether the output should use terminal escape codes to indicate a hyperlink to a
file url pointing to the path.
The value can be auto, always, or never.
Currently, the default is "never", and if the option is used without an argument "auto" is
used. In the future this may be changed to "auto" and "always".
.RS
.IP auto
Only output hyperlinks if color is also enabled, as a proxy for whether terminal escape
codes are acceptable.
.IP never
Never output hyperlink escapes.
.IP always
Always output hyperlink escapes, regardless of color settings.
.RE
.TP
.BI "\-j, \-\-threads " num
Set number of threads to use for searching & executing (default: number of available CPU cores).
.TP
.BI "\-S, \-\-size " size
Limit results based on the size of files using the format
.I <+-><NUM><UNIT>
.RS
.IP '+'
file size must be greater than or equal to this
.IP '-'
file size must be less than or equal to this
.P
If neither '+' nor '-' is specified, file size must be exactly equal to this.
.IP 'NUM'
The numeric size (e.g. 500)
.IP 'UNIT'
The units for NUM. They are not case-sensitive.
Allowed unit values:
.RS
.IP 'b'
bytes
.IP 'k'
kilobytes (base ten, 10^3 = 1000 bytes)
.IP 'm'
megabytes
.IP 'g'
gigabytes
.IP 't'
terabytes
.IP 'ki'
kibibytes (base two, 2^10 = 1024 bytes)
.IP 'mi'
mebibytes
.IP 'gi'
gibibytes
.IP 'ti'
tebibytes
.RE
.RE
.TP
.BI "\-\-changed-within " date|duration
Filter results based on the file modification time.
Files with modification timestamps greater than the argument will be returned.
The argument can be provided as a duration (\fI10h, 1d, 35min\fR) or as a specific point
in time as full RFC3339 format with time zone, as a date or datetime in the
local time zone (\fIYYYY-MM-DD\fR or \fIYYYY-MM-DD HH:MM:SS\fR), or as the prefix '@'
followed by the number of seconds since the Unix epoch (@[0-9]+).
\fB\-\-change-newer-than\fR,
.B --newer
or
.B --changed-after
can be used as aliases.
Examples:
\-\-changed-within 2weeks
\-\-change-newer-than "2018-10-27 10:00:00"
\-\-newer 2018-10-27
\-\-changed-after @1704067200
.TP
.BI "\-\-changed-before " date|duration
Filter results based on the file modification time.
Files with modification timestamps less than the argument will be returned.
The argument can be provided as a duration (\fI10h, 1d, 35min\fR) or as a specific point
in time as full RFC3339 format with time zone, as a date or datetime in the
local time zone (\fIYYYY-MM-DD\fR or \fIYYYY-MM-DD HH:MM:SS\fR), or as the prefix '@'
followed by the number of seconds since the Unix epoch (@[0-9]+).
.B --change-older-than
or
.B --older
can be used as aliases.
Examples:
\-\-changed-before "2018-10-27 10:00:00"
\-\-change-older-than 2weeks
\-\-older @1704067200
.TP
.BI "-o, \-\-owner " [user][:group]
Filter files by their user and/or group. Format: [(user|uid)][:(group|gid)]. Either side
is optional. Precede either side with a '!' to exclude files instead.
Examples:
\-\-owner john
\-\-owner :students
\-\-owner "!john:students"
.TP
.BI "-C, \-\-base\-directory " path
Change the current working directory of fd to the provided path. This means that search results will
be shown with respect to the given base path. Note that relative paths which are passed to fd via the
positional \fIpath\fR argument or the \fB\-\-search\-path\fR option will also be resolved relative to
this directory.
.TP
.BI "\-\-path\-separator " separator
Set the path separator to use when printing file paths. The default is the OS-specific separator
('/' on Unix, '\\' on Windows).
.TP
.BI "\-\-search\-path " search\-path
Provide paths to search as an alternative to the positional \fIpath\fR argument. Changes the usage to
\'fd [FLAGS/OPTIONS] \-\-search\-path PATH \-\-search\-path PATH2 [PATTERN]\'
.TP
.BI "\-\-format " fmt
Specify a template string that is used for printing a line for each file found.
The following placeholders are substituted into the string for each file before printing:
.RS
.IP {}
path (of the current search result)
.IP {/}
basename
.IP {//}
parent directory
.IP {.}
path without file extension
.IP {/.}
basename without file extension
.IP {{
literal '{' (an escape sequence)
.IP }}
literal '}' (an escape sequence)
.P
Notice that you can use "{{" and "}}" to escape "{" and "}" respectively, which is especially
useful if you need to include the literal text of one of the above placeholders.
.RE
.TP
.BI "\-x, \-\-exec " command
.RS
Execute
.I command
for each search result in parallel (use --threads=1 for sequential command execution).
Note that all subsequent positional arguments are considered to be arguments to the
.I command
- not to fd.
It is therefore recommended to place the \-x/\-\-exec option last. Alternatively, you can supply
a ';' argument to end the argument list and continue with more fd options.
Most shells require ';' to be escaped: '\\;'.
This option can be specified multiple times, in which case all commands are run for each
file found, in the order they are provided. In that case, you must supply a ';' argument for
all but the last commands.
If parallelism is enabled, the order commands will be executed in is non-deterministic. And even with
--threads=1, the order is determined by the operating system and may not be what you expect. Thus, it is
recommended that you don't rely on any ordering of the results.
Before executing the command, any placeholder patterns in the command are replaced with the
corresponding values for the current file. The same placeholders are used as in the "\-\-format"
option.
If no placeholder is present, an implicit "{}" at the end is assumed.
If --print0 is also given, then a null character (\\0) will be printed between the output for each found entry.
This allows another program to easily distinguish the output for each file if the command(s) produce multiple lines.
Examples:
- find all *.zip files and unzip them:
fd -e zip -x unzip
- find *.h and *.cpp files and run "clang-format -i .." for each of them:
fd -e h -e cpp -x clang-format -i
- Convert all *.jpg files to *.png files:
fd -e jpg -x convert {} {.}.png
- Run stat for each *.txt file, separated by null characters
fd -0 -e txt -x stat
.RE
.TP
.BI "\-X, \-\-exec-batch " command
.RS
Execute
.I command
once, with all search results as arguments.
The order of the arguments is non-deterministic and should not be relied upon.
This uses the same placeholders as "\-\-format" and "\-\-exec", but instead of expanding
once per command invocation each argument containing a placeholder is expanding for every
file in a batch and passed as separate arguments.
If no placeholder is present, an implicit "{}" at the end is assumed.
Like \-\-exec, subsequent arguments are assumed to be part of
.I command
until either the end of command arguments or a ';' argument. See above.
Like \-\-exec, this can be used multiple times, in which case each command will be run in
the order given.
Examples:
- Find all test_*.py files and open them in your favorite editor:
fd -g 'test_*.py' -X vim
Note that this executes a single "vim" process with all search results as arguments.
- Find all *.rs files and count the lines with "wc -l ...":
fd -e rs -X wc -l
.RE
.TP
.BI "\-\-batch-size " size
Maximum number of arguments to pass to the command given with -X. If the number of results is
greater than the given size, the command given with -X is run again with remaining arguments. A
batch size of zero means there is no limit (default), but note that batching might still happen
due to OS restrictions on the maximum length of command lines.
.SH PATTERN SYNTAX
The regular expression syntax used by fd is documented here:
https://docs.rs/regex/1.0.0/regex/#syntax
The glob syntax is documented here:
https://docs.rs/globset/#syntax
.SH ENVIRONMENT
.TP
.B LS_COLORS
Determines how to colorize search results, see
.BR dircolors (1) .
.TP
.B NO_COLOR
Disables colorized output.
.TP
.B XDG_CONFIG_HOME, HOME
Used to locate the global ignore file. If
.B XDG_CONFIG_HOME
is set, use
.IR $XDG_CONFIG_HOME/fd/ignore .
Otherwise, use
.IR $HOME/.config/fd/ignore .
.SH FILES
.TP
.B .fdignore
This file works similarly to a .gitignore file anywhere in the searched tree and specifies patterns
that should be excluded from the search. However, this file is specific to fd, and will be used even
if the --no-ignore-vcs option is used.
.TP
.B $XDG_CONFIG_HOME/fd/ignore
Global ignore file. Unless ignore mode is turned off (such as with --no-ignore)
ignore entries in this file will be ignored, as if it was an .fdignore file in the
current directory.
.SH EXAMPLES
.TP
.RI "Find files and directories that match the pattern '" needle "':"
$ fd needle
.TP
.RI "Start a search in a given directory (" /var/log "):"
$ fd nginx /var/log
.TP
.RI "Find all Python files (all files with the extension " .py ") in the current directory:"
$ fd -e py
.TP
.RI "Open all search results with vim:"
$ fd pattern -X vim
.SH Tips and Tricks
.IP \[bu]
If you add ".git/" to your global ignore file ($XDG_CONFIG_HOME/fd/ignore), then
".git" folders will be ignored by default, even when the --hidden option is used.
.IP \[bu]
You can use a shell alias or a wrapper script in order to pass desired flags to fd
by default. For example if you do not like the default behavior of respecting gitignore,
you can use
`alias fd="/usr/bin/fd --no-ignore-vcs"`
in your .bashrc to create an alias for fd that doesn't ignore git files by default.
.SH BUGS
Bugs can be reported on GitHub: https://github.com/sharkdp/fd/issues
.SH SEE ALSO
.BR find (1)
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

+161
View File
@@ -0,0 +1,161 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="66mm"
height="66mm"
viewBox="0 0 66 66.000001"
version="1.1"
id="svg5"
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
sodipodi:docname="logo.svg"
inkscape:export-filename="/home/shark/Informatik/rust/fd/doc/logo.png"
inkscape:export-xdpi="192.42"
inkscape:export-ydpi="192.42"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="1"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="2.1795515"
inkscape:cx="114.47309"
inkscape:cy="176.18304"
inkscape:window-width="1920"
inkscape:window-height="1175"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
showguides="false"
inkscape:guide-bbox="true"
inkscape:snap-global="false"
fit-margin-top="2"
fit-margin-left="2"
fit-margin-right="2"
fit-margin-bottom="2"
lock-margins="true">
<sodipodi:guide
position="26.228232,26.126763"
orientation="0,-1"
id="guide47826" />
<sodipodi:guide
position="25.799494,2.3628924"
orientation="0,-1"
id="guide47828" />
</sodipodi:namedview>
<defs
id="defs2" />
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-21.358009,-148.28012)">
<g
id="g66267"
transform="matrix(0.84959471,0,0,0.84959471,7.9920783,43.351816)">
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:29.7126px;line-height:0;font-family:'Fira Sans Condensed';-inkscape-font-specification:'Fira Sans Condensed, ';white-space:pre;inline-size:37.3715;fill:#e5e5e5;fill-opacity:1;stroke-width:0.742816"
x="50.647034"
y="173.19841"
id="text50653"
transform="matrix(1.0604862,0,0,1.0604862,-3.3101428,-10.150043)"><tspan
x="50.647034"
y="173.19841"
id="tspan66635"><tspan
style="font-family:'Source Code Pro';-inkscape-font-specification:'Source Code Pro'"
id="tspan66633">fd</tspan></tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:29.7126px;line-height:0;font-family:'Fira Sans Condensed';-inkscape-font-specification:'Fira Sans Condensed, ';white-space:pre;inline-size:37.3715;fill:#00ccff;fill-opacity:0.996078;stroke-width:0.742816"
x="50.647034"
y="173.19841"
id="text1244"
transform="matrix(1.0604862,0,0,1.0604862,-2.8008599,-9.6407599)"><tspan
x="50.647034"
y="173.19841"
id="tspan66639"><tspan
style="font-family:'Source Code Pro';-inkscape-font-specification:'Source Code Pro'"
id="tspan66637">fd</tspan></tspan></text>
<g
id="g47824"
transform="translate(0.1724878,-0.35338542)">
<g
id="g42041">
<path
style="fill:none;stroke:#939dac;stroke-width:1.065;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 28.209616,155.51329 v 15.68758 H 40.83001"
id="path39763"
sodipodi:nodetypes="ccc" />
<path
style="fill:#b7bec8;stroke:#939dac;stroke-width:1.065;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 27.869464,161.83767 H 40.261291"
id="path39765" />
</g>
<g
id="g41945"
transform="translate(-1.0583333)">
<path
style="fill:#0088aa;fill-opacity:0.993797;stroke:none;stroke-width:0.265;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 42.164961,159.42939 -1.554274,-1.89462 -1.975227,-0.005 c -0.941841,0.014 -1.165466,0.27232 -1.14085,2.88812 z"
id="path40006"
sodipodi:nodetypes="ccccc" />
<rect
style="fill:#01ccff;fill-opacity:1;stroke:none;stroke-width:2.3;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.80126;paint-order:stroke fill markers"
id="rect39949"
width="9.4925022"
height="6.2080379"
x="37.492516"
y="158.82776"
ry="0.90871465" />
</g>
<g
id="g41951"
transform="translate(-1.0583334,9.3665773)">
<path
style="fill:#373e48;fill-opacity:0.993797;stroke:none;stroke-width:0.265;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 42.164961,159.42939 -1.554274,-1.89462 -1.975227,-0.005 c -0.941841,0.014 -1.165466,0.27232 -1.14085,2.88812 z"
id="path41947"
sodipodi:nodetypes="ccccc" />
<rect
style="fill:#535d6c;fill-opacity:0.993797;stroke:none;stroke-width:2.3;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.80126;paint-order:stroke fill markers"
id="rect41949"
width="9.4925022"
height="6.2080379"
x="37.492516"
y="158.82776"
ry="0.90871465" />
</g>
<g
id="g41957"
transform="translate(-14.306994,-6.8962642)">
<path
style="fill:#373e48;fill-opacity:0.993797;stroke:none;stroke-width:0.265;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 42.164961,159.42939 -1.554274,-1.89462 -1.975227,-0.005 c -0.941841,0.014 -1.165466,0.27232 -1.14085,2.88812 z"
id="path41953"
sodipodi:nodetypes="ccccc" />
<rect
style="fill:#535d6c;fill-opacity:0.993797;stroke:none;stroke-width:2.3;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.80126;paint-order:stroke fill markers"
id="rect41955"
width="9.4925022"
height="6.2080379"
x="37.492516"
y="158.82776"
ry="0.90871465" />
</g>
</g>
<g
id="g65006"
transform="matrix(0.55302761,0,0,0.55302761,66.463548,117.45819)" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.8 KiB

+69
View File
@@ -0,0 +1,69 @@
# Release checklist
This file can be used as-is, or copied into the GitHub PR description which includes
necessary changes for the upcoming release.
## Version bump
This section can be done by running `scripts/version-bump.sh` with the new version
as an argument.
- [ ] Create a new branch for the required changes for this release.
- [ ] Update version in `Cargo.toml`. Run `cargo build` to update `Cargo.lock`.
Make sure to `git add` the `Cargo.lock` changes as well.
- [ ] Find the current min. supported Rust version by running
`grep rust-version Cargo.toml`.
- [ ] Update the `fd` version and the min. supported Rust version in `README.md`.
- [ ] Update `CHANGELOG.md`. Change the heading of the *"Upcoming release"* section
to the version of this release.
## Pre-release checks and updates
- [ ] Install the latest version (`cargo install --locked -f --path .`) and make
sure that it is available on the `PATH` (`fd --version` should show the
new version).
- [ ] Review `-h`, `--help`, and the `man` page.
- [ ] Run `fd -h` and copy the output to the *"Command-line options"* section in
the README. This can be done by running `gawk -i inplace -f scripts/update-help.awk README.md`.
- [ ] Push all changes and wait for CI to succeed (before continuing with the
next section).
- [ ] Optional: manually test the new features and command-line options described
in the `CHANGELOG.md`.
- [ ] Run `cargo publish --dry-run` to make sure that it will succeed later
(after creating the GitHub release).
## Release
- [ ] Merge your release branch (should be a fast-forward merge).
- [ ] Create a tag and push it: `git tag vX.Y.Z; git push origin tag vX.Y.Z`.
This will trigger the deployment via GitHub Actions.
REMINDER: If your `origin` is a fork, don't forget to push to e.g. `upstream`
instead.
- [ ] Go to https://github.com/sharkdp/fd/releases/new to create the new
release. Select the new tag and also use it as the release title. For the
release notes, copy the corresponding section from `CHANGELOG.md` and
possibly add additional remarks for package maintainers.
Publish the release.
- [ ] Check if the binary deployment works (archives and Debian packages should
appear when the CI run *for the Git tag* has finished).
- [ ] Publish to crates.io by running `cargo publish` in a *clean* repository.
One way to do this is to clone a fresh copy.
## Post-release
- [ ] Prepare a new *"Upcoming release"* section at the top of `CHANGELOG.md`.
Put this at the top:
# Upcoming release
## Features
## Bugfixes
## Changes
## Other
+64
View File
@@ -0,0 +1,64 @@
#!/bin/bash
# Designed to be executed via svg-term from the fd root directory:
# svg-term --command="bash doc/screencast.sh" --out doc/screencast.svg --padding=10
# Then run this (workaround for #1003):
# sed -i '' 's/<text/<text font-size="1.67"/g' doc/screencast.svg
set -e
set -u
PROMPT="▶"
enter() {
INPUT=$1
DELAY=1
prompt
sleep "$DELAY"
type "$INPUT"
sleep 0.5
printf '%b' "\\n"
eval "$INPUT"
type "\\n"
}
prompt() {
printf '%b ' "$PROMPT" | pv -q
}
type() {
printf '%b' "$1" | pv -qL $((10+(-2 + RANDOM%5)))
}
main() {
IFS='%'
enter "fd"
enter "fd app"
enter "fd fi"
enter "fd fi --type f"
enter "fd --type d"
enter "fd -e md"
enter "fd -e md --exec wc -l"
enter "fd '^[A-Z]'"
enter "fd --exclude src"
enter "fd --hidden sample"
prompt
sleep 3
echo ""
unset IFS
}
main
+1
View File
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 124 KiB

+12
View File
@@ -0,0 +1,12 @@
## Sponsors
`fd` development is sponsored by many individuals and companies. Thank you very much!
Please note, that being sponsored does not affect the individuality of the `fd`
project or affect the maintainers' actions in any way.
We remain impartial and continue to assess pull requests solely on merit - the
features added, bugs solved, and effect on the overall complexity of the code.
No issue will have a different priority based on sponsorship status of the
reporter.
Contributions from anybody are most welcomed, please see our [`CONTRIBUTING.md`](../CONTRIBUTING.md) guide.
+1
View File
@@ -0,0 +1 @@
# Defaults are used
+67
View File
@@ -0,0 +1,67 @@
#!/bin/bash
#
# Create a .tar.gz archive of the fd project for distribution
#
# Expected environment variables:
#
# TARGET: rust target to publish. Defaults to default rustc target
# BIN_PATH: path to fd binary
# PKG_STAGING: directory to use for staging files to include in the archive
# ARCHIVE_NAME: Name of output file, minus extension, defaults to "fd" with a version appended
# if VERSION is specified
# VERSION: version to publish
# GITHUB_OUTPUT: file to store github output variables in
if [[ -z "$TARGET" ]]; then
TARGET="$(rustc -vV | sed -n 's/host: //p')"
fi
PKG_suffix=".tar.gz"
EXE_suffix=""
case ${TARGET} in
*-pc-windows-*)
PKG_suffix=".zip"
EXE_suffix=".exe"
;;
esac
if [[ -z $BIN_PATH ]]; then
BIN_PATH=target/${PROFILE:-release}/fd
fi
if [[ -z "$ARCHIVE_NAME" ]]; then
ARCHIVE_NAME=fd
[[ -n "$VERSION" ]] && ARCHIVE_NAME+="-v$VERSION"
fi
PKG_NAME=${ARCHIVE_NAME}${PKG_suffix}
staging_dir="${PKG_STAGING:-package}"
ARCHIVE_DIR="${staging_dir}/${ARCHIVE_NAME}/"
mkdir -p "${ARCHIVE_DIR}"
# Binary
cp "${BIN_PATH}" "$ARCHIVE_DIR"
# README, LICENSE and CHANGELOG files
cp "README.md" "LICENSE-MIT" "LICENSE-APACHE" "CHANGELOG.md" "$ARCHIVE_DIR"
# Man page
cp "doc/fd.1" "$ARCHIVE_DIR"
# Autocompletion files
cp -r autocomplete "${ARCHIVE_DIR}"
# base compressed package
pushd "${staging_dir}/" >/dev/null
case ${TARGET} in
*-pc-windows-*) 7z -y a "${PKG_NAME}" "${ARCHIVE_NAME}"/* | tail -2 ;;
*) tar czf "${PKG_NAME}" "${ARCHIVE_NAME}"/* ;;
esac;
popd >/dev/null
if [[ -n "$GITHUB_OUTPUT" ]]; then
echo "PKG_NAME=${PKG_NAME}" >> $GITHUB_OUTPUT
# Let subsequent steps know where to find the compressed package
echo "PKG_PATH=${PKG_STAGING}/${PKG_NAME}" >> $GITHUB_OUTPUT
fi
+135
View File
@@ -0,0 +1,135 @@
#!/bin/bash
COPYRIGHT_YEARS="2018 - "$(date "+%Y")
MAINTAINER="David Peter <mail@david-peter.de>"
REPO="https://github.com/sharkdp/fd"
DPKG_STAGING="${CICD_INTERMEDIATES_DIR:-.}/debian-package"
DPKG_DIR="${DPKG_STAGING}/dpkg"
mkdir -p "${DPKG_DIR}"
if [[ -z "$TARGET" ]]; then
TARGET="$(rustc -vV | sed -n 's|host: \(.*\)|\1|p')"
fi
case "$TARGET" in
*-musl*)
DPKG_BASENAME=fd-musl
DPKG_CONFLICTS="fd, fd-find"
;;
*)
DPKG_BASENAME=fd
DPKG_CONFLICTS="fd-musl, fd-find"
;;
esac
if [[ -z "$DPKG_VERSION" ]]; then
DPKG_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r .packages[0].version)
fi
unset DPKG_ARCH
case "${TARGET}" in
aarch64-*-linux-*) DPKG_ARCH=arm64 ;;
arm-*-linux-*hf) DPKG_ARCH=armhf ;;
i686-*-linux-*) DPKG_ARCH=i686 ;;
x86_64-*-linux-*) DPKG_ARCH=amd64 ;;
*) DPKG_ARCH=notset ;;
esac;
DPKG_NAME="${DPKG_BASENAME}_${DPKG_VERSION}_${DPKG_ARCH}.deb"
BIN_PATH=${BIN_PATH:-target/${TARGET}/release/fd}
# Binary
install -Dm755 "${BIN_PATH}" "${DPKG_DIR}/usr/bin/fd"
# Man page
install -Dm644 'doc/fd.1' "${DPKG_DIR}/usr/share/man/man1/fd.1"
gzip -n --best "${DPKG_DIR}/usr/share/man/man1/fd.1"
# Autocompletion files
install -Dm644 'autocomplete/fd.bash' "${DPKG_DIR}/usr/share/bash-completion/completions/fd"
install -Dm644 'autocomplete/fd.fish' "${DPKG_DIR}/usr/share/fish/vendor_completions.d/fd.fish"
install -Dm644 'autocomplete/_fd' "${DPKG_DIR}/usr/share/zsh/vendor-completions/_fd"
# README and LICENSE
install -Dm644 "README.md" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/README.md"
install -Dm644 "LICENSE-MIT" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/LICENSE-MIT"
install -Dm644 "LICENSE-APACHE" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/LICENSE-APACHE"
install -Dm644 "CHANGELOG.md" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/changelog"
gzip -n --best "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/changelog"
# Create symlink and completions so fdfind can be used as well:
ln -s "/usr/bin/fd" "${DPKG_DIR}/usr/bin/fdfind"
install -Dm644 'autocomplete/fdfind.bash' "${DPKG_DIR}/usr/share/bash-completion/completions/fdfind"
install -Dm644 'autocomplete/fdfind.fish' "${DPKG_DIR}/usr/share/fish/vendor_completions.d/fdfind.fish"
install -Dm644 'autocomplete/_fdfind' "${DPKG_DIR}/usr/share/zsh/vendor-completions/_fdfind"
cat > "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/copyright" <<EOF
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: fd
Source: ${REPO}
Files: *
Copyright: ${MAINTAINER}
Copyright: $COPYRIGHT_YEARS ${MAINTAINER}
License: Apache-2.0 or MIT
License: Apache-2.0
On Debian systems, the complete text of the Apache-2.0 can be found in the
file /usr/share/common-licenses/Apache-2.0.
License: MIT
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
.
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
EOF
chmod 644 "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/copyright"
# control file
mkdir -p "${DPKG_DIR}/DEBIAN"
cat > "${DPKG_DIR}/DEBIAN/control" <<EOF
Package: ${DPKG_BASENAME}
Version: ${DPKG_VERSION}
Section: utils
Priority: optional
Maintainer: ${MAINTAINER}
Homepage: ${REPO}
Architecture: ${DPKG_ARCH}
Provides: fd
Conflicts: ${DPKG_CONFLICTS}
Description: simple, fast and user-friendly alternative to find
fd is a program to find entries in your filesystem.
It is a simple, fast and user-friendly alternative to find.
While it does not aim to support all of finds powerful functionality, it provides
sensible (opinionated) defaults for a majority of use cases.
EOF
DPKG_PATH="${DPKG_STAGING}/${DPKG_NAME}"
if [[ -n $GITHUB_OUTPUT ]]; then
echo "DPKG_NAME=${DPKG_NAME}" >> "$GITHUB_OUTPUT"
echo "DPKG_PATH=${DPKG_PATH}" >> "$GITHUB_OUTPUT"
fi
# build dpkg
fakeroot dpkg-deb --build "${DPKG_DIR}" "${DPKG_PATH}"
+41
View File
@@ -0,0 +1,41 @@
#!/usr/bin/gawk -f
BEGIN {
inSection = 0
inBlock = 0
}
/Command-line options/ { inSection=1 }
inSection && /^```/ {
inBlock=1
inSection=0
# print the starting fence then move to next line
print
next
}
inBlock && /^```/ {
cmd="cargo run --release --quiet -- -h"
# Output the results of fd -h
u=0
while (cmd | getline line) {
# Skip everything before the usage line
if (line ~ /^Usage/) {
u=1;
}
if (u) {
print line
}
}
status = close(cmd)
if (status) {
print "failed to generate help output" > "/dev/stderr"
exit 1
}
inBlock = 0
}
!inBlock
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/bash
set -eu
# This script automates the "Version bump" section
version="$1"
if [[ -z $version ]]; then
echo "Usage: must supply version as first argument" >&2
exit 1
fi
git switch -C "release-$version"
sed -i -e "0,/^\[badges/{s/^version =.*/version = \"$version\"/}" Cargo.toml
msrv="$(grep -F rust-version Cargo.toml | sed -e 's/^rust-version= "\(.*\)"/\1/')"
sed -i -e "s/Note that rust version \*[0-9.]+\* or later/Note that rust version *$msrv* or later/" README.md
sed -i -e "s/^# Upcoming release/# $version/" CHANGELOG.md
+971
View File
@@ -0,0 +1,971 @@
use std::num::NonZeroUsize;
use std::path::{Path, PathBuf};
use std::time::Duration;
use anyhow::anyhow;
use clap::{
Arg, ArgAction, ArgGroup, ArgMatches, Command, Parser, ValueEnum, error::ErrorKind,
value_parser,
};
#[cfg(feature = "completions")]
use clap_complete::Shell;
use normpath::PathExt;
use crate::error::print_error;
use crate::exec::CommandSet;
use crate::filesystem;
#[cfg(unix)]
use crate::filter::OwnerFilter;
use crate::filter::SizeFilter;
#[derive(Parser)]
#[command(
name = "fd",
version,
about = "A program to find entries in your filesystem with regex and glob based matching. By default, fd respects gitignore rules, ignores hidden directories, and is case insensitive.",
after_long_help = "Bugs can be reported on GitHub: https://github.com/sharkdp/fd/issues",
max_term_width = 98,
args_override_self = true,
group(ArgGroup::new("execs").args(&["exec", "exec_batch", "list_details"]).conflicts_with_all(&[
"max_results", "quiet", "max_one_result"])),
)]
pub struct Opts {
/// Include hidden directories and files in the search results (default:
/// hidden files and directories are skipped). Files and directories are
/// considered to be hidden if their name starts with a `.` sign (dot).
/// Any files or directories that are ignored due to the rules described by
/// --no-ignore are still ignored unless otherwise specified.
/// The flag can be overridden with --no-hidden.
#[arg(
long,
short = 'H',
help = "Search hidden files and directories",
long_help
)]
pub hidden: bool,
/// Overrides --hidden
#[arg(long, overrides_with = "hidden", hide = true, action = ArgAction::SetTrue)]
no_hidden: (),
/// Show search results from files and directories that would otherwise be
/// ignored by '.gitignore', '.ignore', '.fdignore', or the global ignore file,
/// The flag can be overridden with --ignore.
#[arg(
long,
short = 'I',
help = "Do not respect .(git|fd)ignore files",
long_help
)]
pub no_ignore: bool,
/// Overrides --no-ignore
#[arg(long, overrides_with = "no_ignore", hide = true, action = ArgAction::SetTrue)]
ignore: (),
///Show search results from files and directories that
///would otherwise be ignored by '.gitignore' files.
///The flag can be overridden with --ignore-vcs.
#[arg(
long,
hide_short_help = true,
help = "Do not respect .gitignore files",
long_help
)]
pub no_ignore_vcs: bool,
/// Overrides --no-ignore-vcs
#[arg(long, overrides_with = "no_ignore_vcs", hide = true, action = ArgAction::SetTrue)]
ignore_vcs: (),
/// Do not require a git repository to respect gitignores.
/// By default, fd will only respect global gitignore rules, .gitignore rules,
/// and local exclude rules if fd detects that you are searching inside a
/// git repository. This flag allows you to relax this restriction such that
/// fd will respect all git related ignore rules regardless of whether you're
/// searching in a git repository or not.
///
///
/// This flag can be disabled with --require-git.
#[arg(
long,
overrides_with = "require_git",
hide_short_help = true,
// same description as ripgrep's flag: ripgrep/crates/core/app.rs
long_help
)]
pub no_require_git: bool,
/// Overrides --no-require-git
#[arg(long, overrides_with = "no_require_git", hide = true, action = ArgAction::SetTrue)]
require_git: (),
/// Show search results from files and directories that would otherwise be
/// ignored by '.gitignore', '.ignore', or '.fdignore' files in parent directories.
/// The flag can be overridden with --ignore-parent.
#[arg(
long,
hide_short_help = true,
help = "Do not respect .(git|fd)ignore files in parent directories",
long_help
)]
pub no_ignore_parent: bool,
/// Overrides --no-ignore-parent
#[arg(long, overrides_with = "no_ignore_parent", hide = true, action = ArgAction::SetTrue)]
ignore_parent: (),
/// Do not respect the global ignore file
#[arg(long, hide = true)]
pub no_global_ignore_file: bool,
/// Perform an unrestricted search, including ignored and hidden files. This is
/// an alias for '--no-ignore --hidden'.
#[arg(long = "unrestricted", short = 'u', overrides_with_all(&["ignore", "no_hidden"]), action(ArgAction::Count), hide_short_help = true,
help = "Unrestricted search, alias for '--no-ignore --hidden'",
long_help,
)]
rg_alias_hidden_ignore: u8,
/// Case-sensitive search (default: smart case)
#[arg(
long,
short = 's',
overrides_with("ignore_case"),
long_help = "Perform a case-sensitive search. By default, fd uses case-insensitive \
searches, unless the pattern contains an uppercase character (smart \
case)."
)]
pub case_sensitive: bool,
/// Perform a case-insensitive search. By default, fd uses case-insensitive
/// searches, unless the pattern contains an uppercase character (smart
/// case).
#[arg(
long,
short = 'i',
overrides_with("case_sensitive"),
help = "Case-insensitive search (default: smart case)",
long_help
)]
pub ignore_case: bool,
/// Perform a glob-based search instead of a regular expression search.
#[arg(
long,
short = 'g',
conflicts_with("fixed_strings"),
help = "Glob-based search (default: regular expression)",
long_help
)]
pub glob: bool,
/// Perform a regular-expression based search (default). This can be used to
/// override --glob.
#[arg(
long,
overrides_with("glob"),
hide_short_help = true,
help = "Regular-expression based search (default)",
long_help
)]
pub regex: bool,
/// Treat the pattern as a literal string instead of a regular expression. Note
/// that this also performs substring comparison. If you want to match on an
/// exact filename, consider using '--glob' or '--exact' instead.
#[arg(
long,
short = 'F',
alias = "literal",
hide_short_help = true,
help = "Treat pattern as literal string instead of regex",
long_help
)]
pub fixed_strings: bool,
/// Perform an exact match. This is equivalent to '--fixed-strings' but requires
/// the pattern to match the entire filename (or path if '--full-path' is used),
/// rather than a substring. Special regex characters in the pattern are treated
/// as literal characters.
#[arg(
long,
conflicts_with_all(["glob", "fixed_strings"]),
hide_short_help = true,
help = "Match the entire filename exactly (literal, non-substring)",
long_help
)]
pub exact: bool,
/// Add additional required search patterns, all of which must be matched. Multiple
/// additional patterns can be specified. The patterns are regular
/// expressions, unless '--glob' or '--fixed-strings' is used.
#[arg(
long = "and",
value_name = "pattern",
help = "Additional search patterns that need to be matched",
long_help,
hide_short_help = true,
allow_hyphen_values = true
)]
pub exprs: Option<Vec<String>>,
/// Shows the full path starting from the root as opposed to relative paths.
/// The flag can be overridden with --relative-path.
#[arg(
long,
short = 'a',
help = "Show absolute instead of relative paths",
long_help
)]
pub absolute_path: bool,
/// Overrides --absolute-path
#[arg(long, overrides_with = "absolute_path", hide = true, action = ArgAction::SetTrue)]
relative_path: (),
/// Use a detailed listing format like 'ls -l'. This is basically an alias
/// for '--exec-batch ls -l' with some additional 'ls' options. This can be
/// used to see more metadata, to show symlink targets and to achieve a
/// deterministic sort order.
#[arg(
long,
short = 'l',
conflicts_with("absolute_path"),
help = "Use a long listing format with file metadata",
long_help
)]
pub list_details: bool,
/// Follow symbolic links
#[arg(
long,
short = 'L',
alias = "dereference",
long_help = "By default, fd does not descend into symlinked directories. Using this \
flag, symbolic links are also traversed. \
Flag can be overridden with --no-follow."
)]
pub follow: bool,
/// Overrides --follow
#[arg(long, overrides_with = "follow", hide = true, action = ArgAction::SetTrue)]
no_follow: (),
/// By default, the search pattern is only matched against the filename (or directory name). Using this flag, the pattern is matched against the full (absolute) path. Example:
/// fd --glob -p '**/.git/config'
#[arg(
long,
short = 'p',
help = "Search full abs. path (default: filename only)",
long_help,
verbatim_doc_comment
)]
pub full_path: bool,
/// Separate search results by the null character (instead of newlines).
/// Useful for piping results to 'xargs'.
#[arg(
long = "print0",
short = '0',
conflicts_with("list_details"),
hide_short_help = true,
help = "Separate search results by the null character",
long_help
)]
pub null_separator: bool,
/// Limit the directory traversal to a given depth. By default, there is no
/// limit on the search depth.
#[arg(
long,
short = 'd',
value_name = "depth",
alias("maxdepth"),
help = "Set maximum search depth (default: none)",
long_help
)]
max_depth: Option<usize>,
/// Only show search results starting at the given depth.
/// See also: '--max-depth' and '--exact-depth'
#[arg(
long,
value_name = "depth",
hide_short_help = true,
alias("mindepth"),
help = "Only show search results starting at the given depth.",
long_help
)]
min_depth: Option<usize>,
/// Only show search results at the exact given depth. This is an alias for
/// '--min-depth <depth> --max-depth <depth>'.
#[arg(long, value_name = "depth", hide_short_help = true, conflicts_with_all(&["max_depth", "min_depth"]),
help = "Only show search results at the exact given depth",
long_help,
)]
exact_depth: Option<usize>,
/// Exclude files/directories that match the given glob pattern. This
/// overrides any other ignore logic. Multiple exclude patterns can be
/// specified.
///
/// Examples:
/// {n} --exclude '*.pyc'
/// {n} --exclude node_modules
#[arg(
long,
short = 'E',
value_name = "glob",
help = "Exclude entries that match the given glob pattern",
long_help
)]
pub exclude: Vec<String>,
/// Do not traverse into directories that match the search criteria. If
/// you want to exclude specific directories, use the '--exclude=…' option.
#[arg(long, hide_short_help = true, conflicts_with_all(&["size", "exact_depth"]),
long_help,
)]
pub prune: bool,
/// Filter the search by type:
/// {n} 'f' or 'file': regular files
/// {n} 'd' or 'dir' or 'directory': directories
/// {n} 'l' or 'symlink': symbolic links
/// {n} 's' or 'socket': socket
/// {n} 'p' or 'pipe': named pipe (FIFO)
/// {n} 'b' or 'block-device': block device
/// {n} 'c' or 'char-device': character device
/// {n}{n} 'x' or 'executable': executables
/// {n} 'e' or 'empty': empty files or directories
///
/// This option can be specified more than once to include multiple file types.
/// Searching for '--type file --type symlink' will show both regular files as
/// well as symlinks. Note that the 'executable' and 'empty' filters work differently:
/// '--type executable' implies '--type file' by default. And '--type empty' searches
/// for empty files and directories, unless either '--type file' or '--type directory'
/// is specified in addition.
///
/// Examples:
/// {n} - Only search for files:
/// {n} fd --type file …
/// {n} fd -tf …
/// {n} - Find both files and symlinks
/// {n} fd --type file --type symlink …
/// {n} fd -tf -tl …
/// {n} - Find executable files:
/// {n} fd --type executable
/// {n} fd -tx
/// {n} - Find empty files:
/// {n} fd --type empty --type file
/// {n} fd -te -tf
/// {n} - Find empty directories:
/// {n} fd --type empty --type directory
/// {n} fd -te -td
#[arg(
long = "type",
short = 't',
value_name = "filetype",
hide_possible_values = true,
value_enum,
help = "Filter by type: file (f), directory (d/dir), symlink (l), \
executable (x), empty (e), socket (s), pipe (p), \
char-device (c), block-device (b)",
long_help
)]
pub filetype: Option<Vec<FileType>>,
/// Filter results by extension. By default, this matches all entry types
/// (including directories whose names end with the extension). Use `--type`
/// to restrict the search to specific types. Multiple extensions can be specified.
///
/// If you want to search for files without extension,
/// you can use the regex '^[^.]+$' as a normal search pattern.
#[arg(
long = "extension",
short = 'e',
value_name = "ext",
help = "Filter by extension",
long_help
)]
pub extensions: Option<Vec<String>>,
/// Limit results based on the size of files using the format <+-><NUM><UNIT>.
/// '+': file size must be greater than or equal to this
/// '-': file size must be less than or equal to this
///
/// If neither '+' nor '-' is specified, file size must be exactly equal to this.
/// 'NUM': The numeric size (e.g. 500)
/// 'UNIT': The units for NUM. They are not case-sensitive.
/// Allowed unit values:
/// 'b': bytes
/// 'k': kilobytes (base ten, 10^3 = 1000 bytes)
/// 'm': megabytes
/// 'g': gigabytes
/// 't': terabytes
/// 'ki': kibibytes (base two, 2^10 = 1024 bytes)
/// 'mi': mebibytes
/// 'gi': gibibytes
/// 'ti': tebibytes
#[arg(long, short = 'S', value_parser = SizeFilter::from_string, allow_hyphen_values = true, verbatim_doc_comment, value_name = "size",
help = "Limit results based on the size of files",
long_help,
verbatim_doc_comment,
)]
pub size: Vec<SizeFilter>,
/// Filter results based on the file modification time. Files with modification times
/// greater than the argument are returned. The argument can be provided
/// as a specific point in time (YYYY-MM-DD HH:MM:SS or @timestamp) or as a duration (10h, 1d, 35min).
/// If the time is not specified, it defaults to 00:00:00.
/// '--change-newer-than', '--newer', or '--changed-after' can be used as aliases.
///
/// Examples:
/// {n} --changed-within 2weeks
/// {n} --change-newer-than '2018-10-27 10:00:00'
/// {n} --newer 2018-10-27
/// {n} --changed-after 1day
#[arg(
long,
alias("change-newer-than"),
alias("newer"),
alias("changed-after"),
value_name = "date|dur",
help = "Filter by file modification time (newer than)",
long_help
)]
pub changed_within: Option<String>,
/// Filter results based on the file modification time. Files with modification times
/// less than the argument are returned. The argument can be provided
/// as a specific point in time (YYYY-MM-DD HH:MM:SS or @timestamp) or as a duration (10h, 1d, 35min).
/// '--change-older-than' or '--older' can be used as aliases.
///
/// Examples:
/// {n} --changed-before '2018-10-27 10:00:00'
/// {n} --change-older-than 2weeks
/// {n} --older 2018-10-27
#[arg(
long,
alias("change-older-than"),
alias("older"),
value_name = "date|dur",
help = "Filter by file modification time (older than)",
long_help
)]
pub changed_before: Option<String>,
/// Filter files by their user and/or group.
/// Format: [(user|uid)][:(group|gid)]. Either side is optional.
/// Precede either side with a '!' to exclude files instead.
///
/// Examples:
/// {n} --owner john
/// {n} --owner :students
/// {n} --owner '!john:students'
#[cfg(unix)]
#[arg(long, short = 'o', value_parser = OwnerFilter::from_string, value_name = "user:group",
help = "Filter by owning user and/or group",
long_help,
)]
pub owner: Option<OwnerFilter>,
/// Instead of printing the file normally, print the format string with the following placeholders replaced:
/// '{}': path (of the current search result)
/// '{/}': basename
/// '{//}': parent directory
/// '{.}': path without file extension
/// '{/.}': basename without file extension
#[arg(
long,
value_name = "fmt",
help = "Print results according to template",
conflicts_with = "list_details"
)]
pub format: Option<String>,
#[command(flatten)]
pub exec: Exec,
/// Maximum number of arguments to pass to the command given with -X.
/// If the number of results is greater than the given size,
/// the command given with -X is run again with remaining arguments.
/// A batch size of zero means there is no limit (default), but note
/// that batching might still happen due to OS restrictions on the
/// maximum length of command lines.
#[arg(
long,
value_name = "size",
hide_short_help = true,
requires("exec_batch"),
value_parser = value_parser!(usize),
default_value_t,
help = "Max number of arguments to run as a batch size with -X",
long_help,
)]
pub batch_size: usize,
/// Add a custom ignore-file in '.gitignore' format. These files have a low precedence.
#[arg(
long,
value_name = "path",
hide_short_help = true,
help = "Add a custom ignore-file in '.gitignore' format",
long_help
)]
pub ignore_file: Vec<PathBuf>,
/// Declare when to use color for the pattern match output
#[arg(
long,
short = 'c',
value_enum,
default_value_t = ColorWhen::Auto,
value_name = "when",
help = "When to use colors",
long_help,
)]
pub color: ColorWhen,
/// Add a terminal hyperlink to a file:// url for each path in the output.
///
/// Auto mode is used if no argument is given to this option.
///
/// This doesn't do anything for --exec and --exec-batch.
#[arg(
long,
alias = "hyper",
value_name = "when",
require_equals = true,
value_enum,
default_value_t = HyperlinkWhen::Never,
default_missing_value = "auto",
num_args = 0..=1,
help = "Add hyperlinks to output paths"
)]
pub hyperlink: HyperlinkWhen,
/// Ignore directories containing the named entry.
#[arg(long, value_name = "name")]
pub ignore_contain: Vec<String>,
/// Set number of threads to use for searching & executing (default: number
/// of available CPU cores)
#[arg(long, short = 'j', value_name = "num", hide_short_help = true, value_parser = str::parse::<NonZeroUsize>)]
pub threads: Option<NonZeroUsize>,
/// Milliseconds to buffer before streaming search results to console
///
/// Amount of time in milliseconds to buffer, before streaming the search
/// results to the console.
#[arg(long, hide = true, value_parser = parse_millis)]
pub max_buffer_time: Option<Duration>,
///Limit the number of search results to 'count' and quit immediately.
#[arg(
long,
value_name = "count",
hide_short_help = true,
overrides_with("max_one_result"),
help = "Limit the number of search results",
long_help
)]
max_results: Option<usize>,
/// Limit the search to a single result and quit immediately.
/// This is an alias for '--max-results=1'.
#[arg(
short = '1',
hide_short_help = true,
overrides_with("max_results"),
help = "Limit search to a single result",
long_help
)]
max_one_result: bool,
/// When the flag is present, the program does not print anything and will
/// return with an exit code of 0 if there is at least one match. Otherwise, the
/// exit code will be 1.
/// '--has-results' can be used as an alias.
#[arg(
long,
short = 'q',
alias = "has-results",
hide_short_help = true,
conflicts_with("max_results"),
help = "Print nothing, exit code 0 if match found, 1 otherwise",
long_help
)]
pub quiet: bool,
/// Enable the display of filesystem errors for situations such as
/// insufficient permissions or dead symlinks.
#[arg(
long,
hide_short_help = true,
help = "Show filesystem errors",
long_help
)]
pub show_errors: bool,
/// Change the current working directory of fd to the provided path. This
/// means that search results will be shown with respect to the given base
/// path. Note that relative paths which are passed to fd via the positional
/// <path> argument or the '--search-path' option will also be resolved
/// relative to this directory.
#[arg(
long,
short = 'C',
value_name = "path",
hide_short_help = true,
help = "Change current working directory",
long_help
)]
pub base_directory: Option<PathBuf>,
/// the search pattern which is either a regular expression (default) or a glob
/// pattern (if --glob is used). If no pattern has been specified, every entry
/// is considered a match. If your pattern starts with a dash (-), make sure to
/// pass '--' first, or it will be considered as a flag (fd -- '-foo').
#[arg(
default_value = "",
hide_default_value = true,
value_name = "pattern",
help = "the search pattern (a regular expression, unless '--glob' is used; optional)",
long_help
)]
pub pattern: String,
/// Set the path separator to use when printing file paths. The default is
/// the OS-specific separator ('/' on Unix, '\' on Windows).
#[arg(
long,
value_name = "separator",
hide_short_help = true,
help = "Set path separator when printing file paths",
long_help
)]
pub path_separator: Option<String>,
/// The directory where the filesystem search is rooted (optional). If
/// omitted, search the current working directory.
#[arg(action = ArgAction::Append,
value_name = "path",
help = "the root directories for the filesystem search (optional)",
long_help,
)]
path: Vec<PathBuf>,
/// Provide paths to search as an alternative to the positional <path>
/// argument. Changes the usage to `fd [OPTIONS] --search-path <path>
/// --search-path <path2> [<pattern>]`
#[arg(
long,
conflicts_with("path"),
value_name = "search-path",
hide_short_help = true,
help = "Provides paths to search as an alternative to the positional <path> argument",
long_help
)]
search_path: Vec<PathBuf>,
/// By default, relative paths are prefixed with './' when -x/--exec,
/// -X/--exec-batch, or -0/--print0 are given, to reduce the risk of a
/// path starting with '-' being treated as a command line option. Use
/// this flag to change this behavior. If this flag is used without a value,
/// it is equivalent to passing "always".
#[arg(long, conflicts_with_all(&["path", "search_path"]), value_name = "when", hide_short_help = true, require_equals = true, long_help)]
strip_cwd_prefix: Option<Option<StripCwdWhen>>,
/// By default, fd will traverse the file system tree as far as other options
/// dictate. With this flag, fd ensures that it does not descend into a
/// different file system than the one it started in. Comparable to the -mount
/// or -xdev filters of find(1).
#[cfg(any(unix, windows))]
#[arg(long, aliases(&["mount", "xdev"]), hide_short_help = true, long_help)]
pub one_file_system: bool,
#[cfg(feature = "completions")]
#[arg(long, hide = true, exclusive = true)]
gen_completions: Option<Option<Shell>>,
}
impl Opts {
pub fn search_paths(&self) -> anyhow::Result<Vec<PathBuf>> {
// would it make sense to concatenate these?
let paths = if !self.path.is_empty() {
&self.path
} else if !self.search_path.is_empty() {
&self.search_path
} else {
let current_directory = Path::new("./");
ensure_current_directory_exists(current_directory)?;
return Ok(vec![self.normalize_path(current_directory)]);
};
Ok(paths
.iter()
.filter_map(|path| {
if filesystem::is_existing_directory(path) {
Some(self.normalize_path(path))
} else {
print_error(format!(
"Search path '{}' is not a directory.",
path.to_string_lossy()
));
None
}
})
.collect())
}
fn normalize_path(&self, path: &Path) -> PathBuf {
if self.absolute_path {
filesystem::absolute_path(path.normalize().unwrap().as_path()).unwrap()
} else if path == Path::new(".") {
// Change "." to "./" as a workaround for https://github.com/BurntSushi/ripgrep/pull/2711
PathBuf::from("./")
} else if path == Path::new("-") {
// Prefix "-" so the underlying walker treats it as a path.
// See sharkdp/fd#849.
Path::new(".").join(path)
} else {
path.to_path_buf()
}
}
pub fn no_search_paths(&self) -> bool {
self.path.is_empty() && self.search_path.is_empty()
}
#[inline]
pub fn rg_alias_ignore(&self) -> bool {
self.rg_alias_hidden_ignore > 0
}
pub fn max_depth(&self) -> Option<usize> {
self.max_depth.or(self.exact_depth)
}
pub fn min_depth(&self) -> Option<usize> {
self.min_depth.or(self.exact_depth)
}
pub fn threads(&self) -> NonZeroUsize {
self.threads.unwrap_or_else(default_num_threads)
}
pub fn max_results(&self) -> Option<usize> {
self.max_results
.filter(|&m| m > 0)
.or_else(|| self.max_one_result.then_some(1))
}
pub fn strip_cwd_prefix<P: FnOnce() -> bool>(&self, auto_pred: P) -> bool {
use self::StripCwdWhen::*;
self.no_search_paths()
&& match self.strip_cwd_prefix.map_or(Auto, |o| o.unwrap_or(Always)) {
Auto => auto_pred(),
Always => true,
Never => false,
}
}
#[cfg(feature = "completions")]
pub fn gen_completions(&self) -> anyhow::Result<Option<Shell>> {
self.gen_completions
.map(|maybe_shell| match maybe_shell {
Some(sh) => Ok(sh),
None => {
Shell::from_env().ok_or_else(|| anyhow!("Unable to get shell from environment"))
}
})
.transpose()
}
}
/// Get the default number of threads to use, if not explicitly specified.
fn default_num_threads() -> NonZeroUsize {
// If we can't get the amount of parallelism for some reason, then
// default to a single thread, because that is safe.
let fallback = NonZeroUsize::MIN;
// To limit startup overhead on massively parallel machines, don't use more
// than 64 threads.
let limit = NonZeroUsize::new(64).unwrap();
std::thread::available_parallelism()
.unwrap_or(fallback)
.min(limit)
}
#[derive(Copy, Clone, PartialEq, Eq, ValueEnum)]
pub enum FileType {
#[value(alias = "f")]
File,
#[value(alias = "d", alias = "dir")]
Directory,
#[value(alias = "l")]
Symlink,
#[value(alias = "b")]
BlockDevice,
#[value(alias = "c")]
CharDevice,
/// A file which is executable by the current effective user
#[value(alias = "x")]
Executable,
#[value(alias = "e")]
Empty,
#[value(alias = "s")]
Socket,
#[value(alias = "p")]
Pipe,
}
#[derive(Copy, Clone, PartialEq, Eq, Debug, ValueEnum)]
pub enum ColorWhen {
/// show colors if the output goes to an interactive console (default)
Auto,
/// always use colorized output
Always,
/// do not use colorized output
Never,
}
#[derive(Copy, Clone, PartialEq, Eq, Debug, ValueEnum)]
pub enum StripCwdWhen {
/// Use the default behavior
Auto,
/// Always strip the ./ at the beginning of paths
Always,
/// Never strip the ./
Never,
}
#[derive(Copy, Clone, PartialEq, Eq, Debug, ValueEnum)]
pub enum HyperlinkWhen {
/// Use hyperlinks only if color is enabled
Auto,
/// Always use hyperlinks when printing file paths
Always,
/// Never use hyperlinks
Never,
}
// there isn't a derive api for getting grouped values yet,
// so we have to use hand-rolled parsing for exec and exec-batch
pub struct Exec {
pub command: Option<CommandSet>,
}
impl clap::FromArgMatches for Exec {
fn from_arg_matches(matches: &ArgMatches) -> clap::error::Result<Self> {
let command = matches
.get_occurrences::<String>("exec")
.map(CommandSet::new)
.or_else(|| {
matches
.get_occurrences::<String>("exec_batch")
.map(CommandSet::new_batch)
})
.transpose()
.map_err(|e| clap::Error::raw(ErrorKind::InvalidValue, e))?;
Ok(Exec { command })
}
fn update_from_arg_matches(&mut self, matches: &ArgMatches) -> clap::error::Result<()> {
*self = Self::from_arg_matches(matches)?;
Ok(())
}
}
impl clap::Args for Exec {
fn augment_args(cmd: Command) -> Command {
cmd.arg(Arg::new("exec")
.action(ArgAction::Append)
.long("exec")
.short('x')
.num_args(1..)
.allow_hyphen_values(true)
.value_terminator(";")
.value_name("cmd")
.conflicts_with("list_details")
.help("Execute a command for each search result")
.long_help(
"Execute a command for each search result in parallel (use --threads=1 for sequential command execution). \
There is no guarantee of the order commands are executed in, and the order should not be depended upon. \
All positional arguments following --exec are considered to be arguments to the command - not to fd. \
It is therefore recommended to place the '-x'/'--exec' option last. \
Use '\\;' to terminate the command template if you need to continue passing fd arguments afterwards.\n\
The following placeholders are substituted before the command is executed:\n \
'{}': path (of the current search result)\n \
'{/}': basename\n \
'{//}': parent directory\n \
'{.}': path without file extension\n \
'{/.}': basename without file extension\n \
'{{': literal '{' (for escaping)\n \
'}}': literal '}' (for escaping)\n\n\
If no placeholder is present, an implicit \"{}\" at the end is assumed.\n\n\
Examples:\n\n \
- find all *.zip files and unzip them:\n\n \
fd -e zip -x unzip\n\n \
- find *.h and *.cpp files and run \"clang-format -i ..\" for each of them:\n\n \
fd -e h -e cpp -x clang-format -i\n\n \
- search within `src/` and echo each match (place `-x` last):\n\n \
fd . src -x echo\n\n \
- Convert all *.jpg files to *.png files:\n\n \
fd -e jpg -x convert {} {.}.png\
",
),
)
.arg(
Arg::new("exec_batch")
.action(ArgAction::Append)
.long("exec-batch")
.short('X')
.num_args(1..)
.allow_hyphen_values(true)
.value_terminator(";")
.value_name("cmd")
.conflicts_with_all(["exec", "list_details"])
.help("Execute a command with all search results at once")
.long_help(
"Execute the given command once, with all search results as arguments.\n\
The order of the arguments is non-deterministic, and should not be relied upon.\n\
One of the following placeholders is substituted before the command is executed:\n \
'{}': path (of all search results)\n \
'{/}': basename\n \
'{//}': parent directory\n \
'{.}': path without file extension\n \
'{/.}': basename without file extension\n \
'{{': literal '{' (for escaping)\n \
'}}': literal '}' (for escaping)\n\n\
If no placeholder is present, an implicit \"{}\" at the end is assumed.\n\n\
Examples:\n\n \
- Find all test_*.py files and open them in your favorite editor:\n\n \
fd -g 'test_*.py' -X vim\n\n \
- Find all *.rs files and count the lines with \"wc -l ...\":\n\n \
fd -e rs -X wc -l\
"
),
)
}
fn augment_args_for_update(cmd: Command) -> Command {
Self::augment_args(cmd)
}
}
fn parse_millis(arg: &str) -> Result<Duration, std::num::ParseIntError> {
Ok(Duration::from_millis(arg.parse()?))
}
fn ensure_current_directory_exists(current_directory: &Path) -> anyhow::Result<()> {
if filesystem::is_existing_directory(current_directory) {
Ok(())
} else {
Err(anyhow!(
"Could not retrieve current directory (has it been deleted?)."
))
}
}
+143
View File
@@ -0,0 +1,143 @@
use std::{path::PathBuf, sync::Arc, time::Duration};
use lscolors::LsColors;
use regex::bytes::RegexSet;
use crate::exec::CommandSet;
use crate::filetypes::FileTypes;
#[cfg(unix)]
use crate::filter::OwnerFilter;
use crate::filter::{SizeFilter, TimeFilter};
use crate::fmt::FormatTemplate;
/// Configuration options for *fd*.
pub struct Config {
/// Whether the search is case-sensitive or case-insensitive.
pub case_sensitive: bool,
/// Cached current working directory for absolute path construction.
/// Populated when `--full-path` is set; `None` means search by filename only.
pub full_path_base: Option<PathBuf>,
/// Whether to ignore hidden files and directories (or not).
pub ignore_hidden: bool,
/// Whether to respect `.fdignore` files or not.
pub read_fdignore: bool,
/// Whether to respect ignore files in parent directories or not.
pub read_parent_ignore: bool,
/// Whether to respect VCS ignore files (`.gitignore`, ..) or not.
pub read_vcsignore: bool,
/// Whether to require a `.git` directory to respect gitignore files.
pub require_git_to_read_vcsignore: bool,
/// Whether to respect the global ignore file or not.
pub read_global_ignore: bool,
/// Whether to follow symlinks or not.
pub follow_links: bool,
/// Whether to limit the search to starting file system or not.
pub one_file_system: bool,
/// Whether elements of output should be separated by a null character
pub null_separator: bool,
/// The maximum search depth, or `None` if no maximum search depth should be set.
///
/// A depth of `1` includes all files under the current directory, a depth of `2` also includes
/// all files under subdirectories of the current directory, etc.
pub max_depth: Option<usize>,
/// The minimum depth for reported entries, or `None`.
pub min_depth: Option<usize>,
/// Whether to stop traversing into matching directories.
pub prune: bool,
/// The number of threads to use.
pub threads: usize,
/// If true, the program doesn't print anything and will instead return an exit code of 0
/// if there's at least one match. Otherwise, the exit code will be 1.
pub quiet: bool,
/// Time to buffer results internally before streaming to the console. This is useful to
/// provide a sorted output, in case the total execution time is shorter than
/// `max_buffer_time`.
pub max_buffer_time: Option<Duration>,
/// `None` if the output should not be colorized. Otherwise, a `LsColors` instance that defines
/// how to style different filetypes.
pub ls_colors: Option<LsColors>,
/// Whether or not we are writing to an interactive terminal
#[cfg_attr(not(unix), allow(unused))]
pub interactive_terminal: bool,
/// The type of file to search for. If set to `None`, all file types are displayed. If
/// set to `Some(..)`, only the types that are specified are shown.
pub file_types: Option<FileTypes>,
/// The extension to search for. Only entries matching the extension will be included.
///
/// The value (if present) will be a lowercase string without leading dots.
pub extensions: Option<RegexSet>,
/// A format string to use to format results, similarly to exec
pub format: Option<FormatTemplate>,
/// If a value is supplied, each item found will be used to generate and execute commands.
pub command: Option<Arc<CommandSet>>,
/// Maximum number of search results to pass to each `command`. If zero, the number is
/// unlimited.
pub batch_size: usize,
/// A list of glob patterns that should be excluded from the search.
pub exclude_patterns: Vec<String>,
/// A list of custom ignore files.
pub ignore_files: Vec<PathBuf>,
/// The given constraints on the size of returned files
pub size_constraints: Vec<SizeFilter>,
/// Constraints on last modification time of files
pub time_constraints: Vec<TimeFilter>,
#[cfg(unix)]
/// User/group ownership constraint
pub owner_constraint: Option<OwnerFilter>,
/// Whether or not to display filesystem errors
pub show_filesystem_errors: bool,
/// The separator used to print file paths.
pub path_separator: Option<String>,
/// The actual separator, either the system default separator or `path_separator`
pub actual_path_separator: String,
/// The maximum number of search results
pub max_results: Option<usize>,
/// Whether or not to strip the './' prefix for search results
pub strip_cwd_prefix: bool,
/// Whether or not to use hyperlinks on paths
pub hyperlink: bool,
/// Names that should stop traversal down their parent. (e.g. https://bford.info/cachedir/).
pub ignore_contain: Vec<String>,
}
impl Config {
/// Check whether results are being printed.
pub fn is_printing(&self) -> bool {
self.command.is_none()
}
}
+189
View File
@@ -0,0 +1,189 @@
use std::cell::OnceCell;
use std::ffi::OsString;
use std::fs::{FileType, Metadata};
use std::path::{Path, PathBuf};
use lscolors::{Colorable, LsColors, Style};
use crate::config::Config;
use crate::filesystem::strip_current_dir;
#[derive(Debug)]
enum DirEntryInner {
Normal(ignore::DirEntry),
BrokenSymlink(PathBuf),
}
#[derive(Debug)]
pub struct DirEntry {
inner: DirEntryInner,
metadata: OnceCell<Option<Metadata>>,
style: OnceCell<Option<Style>>,
}
impl DirEntry {
#[inline]
pub fn normal(e: ignore::DirEntry) -> Self {
Self {
inner: DirEntryInner::Normal(e),
metadata: OnceCell::new(),
style: OnceCell::new(),
}
}
pub fn broken_symlink(path: PathBuf) -> Self {
Self {
inner: DirEntryInner::BrokenSymlink(path),
metadata: OnceCell::new(),
style: OnceCell::new(),
}
}
pub fn path(&self) -> &Path {
match &self.inner {
DirEntryInner::Normal(e) => e.path(),
DirEntryInner::BrokenSymlink(pathbuf) => pathbuf.as_path(),
}
}
pub fn into_path(self) -> PathBuf {
match self.inner {
DirEntryInner::Normal(e) => e.into_path(),
DirEntryInner::BrokenSymlink(p) => p,
}
}
/// Returns the path as it should be presented to the user.
/// When stripping `./` would leave the path starting with `-`, keep the original
/// (with `./`) so downstream tools don't interpret it as an option.
pub fn stripped_path(&self, config: &Config) -> &Path {
let path = self.path();
if config.strip_cwd_prefix {
let stripped = strip_current_dir(path);
if starts_with_dash(stripped) {
path
} else {
stripped
}
} else {
path
}
}
/// Returns the path as it should be presented to the user.
pub fn into_stripped_path(self, config: &Config) -> PathBuf {
if config.strip_cwd_prefix {
self.stripped_path(config).to_path_buf()
} else {
self.into_path()
}
}
pub fn file_type(&self) -> Option<FileType> {
match &self.inner {
DirEntryInner::Normal(e) => e.file_type(),
DirEntryInner::BrokenSymlink(_) => self.metadata().map(|m| m.file_type()),
}
}
pub fn metadata(&self) -> Option<&Metadata> {
self.metadata
.get_or_init(|| match &self.inner {
DirEntryInner::Normal(e) => e.metadata().ok(),
DirEntryInner::BrokenSymlink(path) => path.symlink_metadata().ok(),
})
.as_ref()
}
pub fn depth(&self) -> Option<usize> {
match &self.inner {
DirEntryInner::Normal(e) => Some(e.depth()),
DirEntryInner::BrokenSymlink(_) => None,
}
}
pub fn style(&self, ls_colors: &LsColors) -> Option<&Style> {
self.style
.get_or_init(|| ls_colors.style_for(self).cloned())
.as_ref()
}
}
fn starts_with_dash(path: &Path) -> bool {
path.as_os_str().as_encoded_bytes().first() == Some(&b'-')
}
impl PartialEq for DirEntry {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.path() == other.path()
}
}
impl Eq for DirEntry {}
impl PartialOrd for DirEntry {
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}
impl Ord for DirEntry {
#[inline]
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.path().cmp(other.path())
}
}
impl Colorable for DirEntry {
fn path(&self) -> PathBuf {
self.path().to_owned()
}
fn file_name(&self) -> OsString {
let name = match &self.inner {
DirEntryInner::Normal(e) => e.file_name(),
DirEntryInner::BrokenSymlink(path) => {
// Path::file_name() only works if the last component is Normal,
// but we want it for all component types, so we open code it.
// Copied from LsColors::style_for_path_with_metadata().
path.components()
.next_back()
.map(|c| c.as_os_str())
.unwrap_or_else(|| path.as_os_str())
}
};
name.to_owned()
}
fn file_type(&self) -> Option<FileType> {
self.file_type()
}
fn metadata(&self) -> Option<Metadata> {
self.metadata().cloned()
}
}
#[cfg(test)]
mod tests {
use super::starts_with_dash;
use std::path::Path;
#[test]
fn dash_prefixed_paths_detected() {
assert!(starts_with_dash(Path::new("-rf")));
assert!(starts_with_dash(Path::new("--delete")));
assert!(starts_with_dash(Path::new("-")));
}
#[test]
fn safe_paths_not_flagged() {
assert!(!starts_with_dash(Path::new("foo")));
assert!(!starts_with_dash(Path::new("./foo")));
assert!(!starts_with_dash(Path::new("sub/-rf")));
assert!(!starts_with_dash(Path::new("")));
assert!(!starts_with_dash(Path::new(" -rf")));
}
}
+9
View File
@@ -0,0 +1,9 @@
use std::io::IsTerminal;
use crate::sanitize::maybe_sanitize;
pub fn print_error(msg: impl Into<String>) {
let msg = msg.into();
let safe = maybe_sanitize(&msg, std::io::stderr().is_terminal());
eprintln!("[fd error]: {safe}");
}
+115
View File
@@ -0,0 +1,115 @@
use std::io;
use std::io::Write;
use argmax::Command;
use crate::error::print_error;
use crate::exit_codes::ExitCode;
struct Outputs {
stdout: Vec<u8>,
stderr: Vec<u8>,
}
pub struct OutputBuffer {
null_separator: bool,
outputs: Vec<Outputs>,
}
impl OutputBuffer {
pub fn new(null_separator: bool) -> Self {
Self {
null_separator,
outputs: Vec::new(),
}
}
fn push(&mut self, stdout: Vec<u8>, stderr: Vec<u8>) {
self.outputs.push(Outputs { stdout, stderr });
}
fn write(self) {
// Avoid taking the lock if there is nothing to do.
// If null_separator is true, then we still need to write the
// null separator, because the output may have been written directly
// to stdout
if self.outputs.is_empty() && !self.null_separator {
return;
}
let stdout = io::stdout();
let stderr = io::stderr();
// While we hold these locks, only this thread will be able
// to write its outputs.
let mut stdout = stdout.lock();
let mut stderr = stderr.lock();
for output in self.outputs.iter() {
let _ = stdout.write_all(&output.stdout);
let _ = stderr.write_all(&output.stderr);
}
if self.null_separator {
// If null_separator is enabled, then we should write a \0 at the end
// of the output for this entry
let _ = stdout.write_all(b"\0");
}
}
}
/// Executes a command.
pub fn execute_commands<I: Iterator<Item = io::Result<Command>>>(
cmds: I,
mut output_buffer: OutputBuffer,
enable_output_buffering: bool,
) -> ExitCode {
for result in cmds {
let mut cmd = match result {
Ok(cmd) => cmd,
Err(e) => return handle_cmd_error(None, e),
};
// Spawn the supplied command.
let output = if enable_output_buffering {
cmd.output()
} else {
// If running on only one thread, don't buffer output
// Allows for viewing and interacting with intermediate command output
cmd.spawn().and_then(|c| c.wait_with_output())
};
// Then wait for the command to exit, if it was spawned.
match output {
Ok(output) => {
if enable_output_buffering {
output_buffer.push(output.stdout, output.stderr);
}
if output.status.code() != Some(0) {
output_buffer.write();
return ExitCode::GeneralError;
}
}
Err(why) => {
output_buffer.write();
return handle_cmd_error(Some(&cmd), why);
}
}
}
output_buffer.write();
ExitCode::Success
}
pub fn handle_cmd_error(cmd: Option<&Command>, err: io::Error) -> ExitCode {
match (cmd, err) {
(Some(cmd), err) if err.kind() == io::ErrorKind::NotFound => {
print_error(format!(
"Command not found: {}",
cmd.get_program().to_string_lossy()
));
ExitCode::GeneralError
}
(_, err) => {
print_error(format!("Problem while executing command: {err}"));
ExitCode::GeneralError
}
}
}
+64
View File
@@ -0,0 +1,64 @@
use crate::config::Config;
use crate::error::print_error;
use crate::exit_codes::{ExitCode, merge_exitcodes};
use crate::walk::WorkerResult;
use super::CommandSet;
/// An event loop that listens for inputs from the `rx` receiver. Each received input will
/// generate a command with the supplied command template. The generated command will then
/// be executed, and this process will continue until the receiver's sender has closed.
pub fn job(
results: impl IntoIterator<Item = WorkerResult>,
cmd: &CommandSet,
config: &Config,
) -> ExitCode {
// Output should be buffered when only running a single thread
let buffer_output: bool = config.threads > 1;
let mut ret = ExitCode::Success;
for result in results {
// Obtain the next result from the receiver, else if the channel
// has closed, exit from the loop
let dir_entry = match result {
WorkerResult::Entry(dir_entry) => dir_entry,
WorkerResult::Error(err) => {
if config.show_filesystem_errors {
print_error(err.to_string());
}
continue;
}
};
// Generate a command, execute it and store its exit code.
let code = cmd.execute(
dir_entry.stripped_path(config),
config.path_separator.as_deref(),
config.null_separator,
buffer_output,
);
ret = merge_exitcodes([ret, code]);
}
// Returns error in case of any error.
ret
}
pub fn batch(
results: impl IntoIterator<Item = WorkerResult>,
cmd: &CommandSet,
config: &Config,
) -> ExitCode {
let paths = results
.into_iter()
.filter_map(|worker_result| match worker_result {
WorkerResult::Entry(dir_entry) => Some(dir_entry.into_stripped_path(config)),
WorkerResult::Error(err) => {
if config.show_filesystem_errors {
print_error(err.to_string());
}
None
}
});
cmd.execute_batch(paths, config.batch_size, config.path_separator.as_deref())
}
+486
View File
@@ -0,0 +1,486 @@
mod command;
mod job;
use std::ffi::OsString;
use std::io;
use std::iter;
use std::path::{Path, PathBuf};
use std::process::Stdio;
use anyhow::{Result, bail};
use argmax::Command;
use crate::exec::command::OutputBuffer;
use crate::exit_codes::{ExitCode, merge_exitcodes};
use crate::fmt::{FormatTemplate, Token};
use self::command::{execute_commands, handle_cmd_error};
pub use self::job::{batch, job};
/// Execution mode of the command
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ExecutionMode {
/// Command is executed for each search result
OneByOne,
/// Command is run for a batch of results at once
Batch,
}
#[derive(Debug, Clone, PartialEq)]
pub struct CommandSet {
mode: ExecutionMode,
commands: Vec<CommandTemplate>,
}
impl CommandSet {
pub fn new<I, T, S>(input: I) -> Result<CommandSet>
where
I: IntoIterator<Item = T>,
T: IntoIterator<Item = S>,
S: AsRef<str>,
{
Ok(CommandSet {
mode: ExecutionMode::OneByOne,
commands: input
.into_iter()
.map(|args| CommandTemplate::new(args, ExecutionMode::OneByOne))
.collect::<Result<_>>()?,
})
}
pub fn new_batch<I, T, S>(input: I) -> Result<CommandSet>
where
I: IntoIterator<Item = T>,
T: IntoIterator<Item = S>,
S: AsRef<str>,
{
Ok(CommandSet {
mode: ExecutionMode::Batch,
commands: input
.into_iter()
.map(|args| {
let cmd = CommandTemplate::new(args, ExecutionMode::Batch)?;
if cmd.number_of_tokens() > 1 {
bail!("Only one placeholder allowed for batch commands");
}
Ok(cmd)
})
.collect::<Result<Vec<_>>>()?,
})
}
pub fn in_batch_mode(&self) -> bool {
self.mode == ExecutionMode::Batch
}
pub fn execute(
&self,
input: &Path,
path_separator: Option<&str>,
null_separator: bool,
buffer_output: bool,
) -> ExitCode {
let commands = self
.commands
.iter()
.map(|c| c.generate(input, path_separator));
execute_commands(commands, OutputBuffer::new(null_separator), buffer_output)
}
pub fn execute_batch<I>(&self, paths: I, limit: usize, path_separator: Option<&str>) -> ExitCode
where
I: Iterator<Item = PathBuf>,
{
let builders: io::Result<Vec<_>> = self
.commands
.iter()
.map(|c| CommandBuilder::new(c, limit))
.collect();
match builders {
Ok(mut builders) => {
for path in paths {
for builder in &mut builders {
if let Err(e) = builder.push(&path, path_separator) {
return handle_cmd_error(Some(&builder.cmd), e);
}
}
}
for builder in &mut builders {
if let Err(e) = builder.finish() {
return handle_cmd_error(Some(&builder.cmd), e);
}
}
merge_exitcodes(builders.iter().map(|b| b.exit_code()))
}
Err(e) => handle_cmd_error(None, e),
}
}
}
/// Represents a multi-exec command as it is built.
#[derive(Debug)]
struct CommandBuilder {
pre_args: Vec<OsString>,
path_arg: FormatTemplate,
post_args: Vec<OsString>,
cmd: Command,
count: usize,
limit: usize,
exit_code: ExitCode,
}
impl CommandBuilder {
fn new(template: &CommandTemplate, limit: usize) -> io::Result<Self> {
let mut pre_args = vec![];
let mut path_arg = None;
let mut post_args = vec![];
for arg in &template.args {
if arg.has_tokens() {
path_arg = Some(arg.clone());
} else if path_arg.is_none() {
pre_args.push(arg.generate("", None));
} else {
post_args.push(arg.generate("", None));
}
}
let cmd = Self::new_command(&pre_args)?;
Ok(Self {
pre_args,
path_arg: path_arg.unwrap(),
post_args,
cmd,
count: 0,
limit,
exit_code: ExitCode::Success,
})
}
fn new_command(pre_args: &[OsString]) -> io::Result<Command> {
let mut cmd = Command::new(&pre_args[0]);
cmd.stdin(Stdio::inherit());
cmd.stdout(Stdio::inherit());
cmd.stderr(Stdio::inherit());
cmd.try_args(&pre_args[1..])?;
Ok(cmd)
}
fn push(&mut self, path: &Path, separator: Option<&str>) -> io::Result<()> {
if self.limit > 0 && self.count >= self.limit {
self.finish()?;
}
let arg = self.path_arg.generate(path, separator);
if !self
.cmd
.args_would_fit(iter::once(&arg).chain(&self.post_args))
{
self.finish()?;
}
self.cmd.try_arg(arg)?;
self.count += 1;
Ok(())
}
fn finish(&mut self) -> io::Result<()> {
if self.count > 0 {
self.cmd.try_args(&self.post_args)?;
if !self.cmd.status()?.success() {
self.exit_code = ExitCode::GeneralError;
}
self.cmd = Self::new_command(&self.pre_args)?;
self.count = 0;
}
Ok(())
}
fn exit_code(&self) -> ExitCode {
self.exit_code
}
}
/// Represents a template that is utilized to generate command strings.
///
/// The template is meant to be coupled with an input in order to generate a command. The
/// `generate_and_execute()` method will be used to generate a command and execute it.
#[derive(Debug, Clone, PartialEq)]
struct CommandTemplate {
args: Vec<FormatTemplate>,
}
impl CommandTemplate {
fn new<I, S>(input: I, mode: ExecutionMode) -> Result<CommandTemplate>
where
I: IntoIterator<Item = S>,
S: AsRef<str>,
{
let mut args = Vec::new();
let mut has_placeholder = false;
for arg in input {
let arg = arg.as_ref();
let tmpl = FormatTemplate::parse(arg);
has_placeholder |= tmpl.has_tokens();
args.push(tmpl);
}
// We need to check that we have at least one argument, because if not
// it will try to execute each file and directory it finds.
//
// Sadly, clap can't currently handle this for us, see
// https://github.com/clap-rs/clap/issues/3542
if args.is_empty() {
bail!("No executable provided for --exec or --exec-batch");
}
// A placeholder as the executable is meaningful for `--exec` but never for `--exec-batch`.
if mode == ExecutionMode::Batch && args[0].has_tokens() {
bail!("First argument of --exec-batch must be a fixed executable, not a placeholder");
}
// If a placeholder token was not supplied, append one at the end of the command.
if !has_placeholder {
args.push(FormatTemplate::Tokens(vec![Token::Placeholder]));
}
Ok(CommandTemplate { args })
}
fn number_of_tokens(&self) -> usize {
self.args.iter().filter(|arg| arg.has_tokens()).count()
}
/// Generates and executes a command.
///
/// Using the internal `args` field, and a supplied `input` variable, a `Command` will be
/// build.
fn generate(&self, input: &Path, path_separator: Option<&str>) -> io::Result<Command> {
let mut cmd = Command::new(self.args[0].generate(input, path_separator));
for arg in &self.args[1..] {
cmd.try_arg(arg.generate(input, path_separator))?;
}
Ok(cmd)
}
}
#[cfg(test)]
mod tests {
use super::*;
fn generate_str(template: &CommandTemplate, input: &str) -> Vec<String> {
template
.args
.iter()
.map(|arg| arg.generate(input, None).into_string().unwrap())
.collect()
}
#[test]
fn tokens_with_placeholder() {
assert_eq!(
CommandSet::new(vec![vec![&"echo", &"${SHELL}:"]]).unwrap(),
CommandSet {
commands: vec![CommandTemplate {
args: vec![
FormatTemplate::Text("echo".into()),
FormatTemplate::Text("${SHELL}:".into()),
FormatTemplate::Tokens(vec![Token::Placeholder]),
]
}],
mode: ExecutionMode::OneByOne,
}
);
}
#[test]
fn tokens_with_no_extension() {
assert_eq!(
CommandSet::new(vec![vec!["echo", "{.}"]]).unwrap(),
CommandSet {
commands: vec![CommandTemplate {
args: vec![
FormatTemplate::Text("echo".into()),
FormatTemplate::Tokens(vec![Token::NoExt]),
],
}],
mode: ExecutionMode::OneByOne,
}
);
}
#[test]
fn tokens_with_basename() {
assert_eq!(
CommandSet::new(vec![vec!["echo", "{/}"]]).unwrap(),
CommandSet {
commands: vec![CommandTemplate {
args: vec![
FormatTemplate::Text("echo".into()),
FormatTemplate::Tokens(vec![Token::Basename]),
],
}],
mode: ExecutionMode::OneByOne,
}
);
}
#[test]
fn tokens_with_parent() {
assert_eq!(
CommandSet::new(vec![vec!["echo", "{//}"]]).unwrap(),
CommandSet {
commands: vec![CommandTemplate {
args: vec![
FormatTemplate::Text("echo".into()),
FormatTemplate::Tokens(vec![Token::Parent]),
],
}],
mode: ExecutionMode::OneByOne,
}
);
}
#[test]
fn tokens_with_basename_no_extension() {
assert_eq!(
CommandSet::new(vec![vec!["echo", "{/.}"]]).unwrap(),
CommandSet {
commands: vec![CommandTemplate {
args: vec![
FormatTemplate::Text("echo".into()),
FormatTemplate::Tokens(vec![Token::BasenameNoExt]),
],
}],
mode: ExecutionMode::OneByOne,
}
);
}
#[test]
fn tokens_with_literal_braces() {
let template =
CommandTemplate::new(vec!["{{}}", "{{", "{.}}"], ExecutionMode::OneByOne).unwrap();
assert_eq!(
generate_str(&template, "foo"),
vec!["{}", "{", "{.}", "foo"]
);
}
#[test]
fn tokens_with_literal_braces_and_placeholder() {
let template =
CommandTemplate::new(vec!["echo", "{{{},end}"], ExecutionMode::OneByOne).unwrap();
assert_eq!(generate_str(&template, "foo"), vec!["echo", "{foo,end}"]);
}
#[test]
fn tokens_multiple() {
assert_eq!(
CommandSet::new(vec![vec!["cp", "{}", "{/.}.ext"]]).unwrap(),
CommandSet {
commands: vec![CommandTemplate {
args: vec![
FormatTemplate::Text("cp".into()),
FormatTemplate::Tokens(vec![Token::Placeholder]),
FormatTemplate::Tokens(vec![
Token::BasenameNoExt,
Token::Text(".ext".into())
]),
],
}],
mode: ExecutionMode::OneByOne,
}
);
}
#[test]
fn tokens_single_batch() {
assert_eq!(
CommandSet::new_batch(vec![vec!["echo", "{.}"]]).unwrap(),
CommandSet {
commands: vec![CommandTemplate {
args: vec![
FormatTemplate::Text("echo".into()),
FormatTemplate::Tokens(vec![Token::NoExt]),
],
}],
mode: ExecutionMode::Batch,
}
);
}
#[test]
fn tokens_multiple_batch() {
assert!(CommandSet::new_batch(vec![vec!["echo", "{.}", "{}"]]).is_err());
}
#[test]
fn template_no_args() {
assert!(
CommandTemplate::new::<Vec<_>, &'static str>(vec![], ExecutionMode::OneByOne).is_err()
);
}
#[test]
fn command_set_no_args() {
assert!(CommandSet::new(vec![vec!["echo"], vec![]]).is_err());
}
#[test]
fn placeholder_as_executable_rejected() {
assert!(CommandSet::new(vec![vec!["{}"]]).is_ok());
assert!(CommandSet::new(vec![vec!["{/}", "arg"]]).is_ok());
assert!(CommandSet::new_batch(vec![vec!["{}"]]).is_err());
}
#[test]
fn generate_custom_path_separator() {
let arg = FormatTemplate::Tokens(vec![Token::Placeholder]);
macro_rules! check {
($input:expr, $expected:expr) => {
assert_eq!(arg.generate($input, Some("#")), OsString::from($expected));
};
}
check!("foo", "foo");
check!("foo/bar", "foo#bar");
check!("/foo/bar/baz", "#foo#bar#baz");
}
#[cfg(windows)]
#[test]
fn generate_custom_path_separator_windows() {
let arg = FormatTemplate::Tokens(vec![Token::Placeholder]);
macro_rules! check {
($input:expr, $expected:expr) => {
assert_eq!(arg.generate($input, Some("#")), OsString::from($expected));
};
}
// path starting with a drive letter
check!(r"C:\foo\bar", "C:#foo#bar");
// UNC path
check!(r"\\server\share\path", "##server#share#path");
// Drive Relative path - no separator after the colon omits the RootDir path component.
// This is uncommon, but valid
check!(r"C:foo\bar", "C:foo#bar");
// forward slashes should get normalized and interpreted as separators
check!("C:/foo/bar", "C:#foo#bar");
check!("C:foo/bar", "C:foo#bar");
// Rust does not interpret "//server/share" as a UNC path, but rather as a normal
// absolute path that begins with RootDir, and the two slashes get combined together as
// a single path separator during normalization.
//check!("//server/share/path", "##server#share#path");
}
}
+94
View File
@@ -0,0 +1,94 @@
use std::process;
#[cfg(unix)]
use nix::sys::signal::{SigHandler, Signal, raise, signal};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ExitCode {
Success,
HasResults(bool),
GeneralError,
KilledBySigint,
}
impl From<ExitCode> for i32 {
fn from(code: ExitCode) -> Self {
match code {
ExitCode::Success => 0,
ExitCode::HasResults(has_results) => !has_results as i32,
ExitCode::GeneralError => 1,
ExitCode::KilledBySigint => 130,
}
}
}
impl ExitCode {
fn is_error(self) -> bool {
i32::from(self) != 0
}
/// Exit the process with the appropriate code.
pub fn exit(self) -> ! {
#[cfg(unix)]
if self == ExitCode::KilledBySigint {
// Get rid of the SIGINT handler, if present, and raise SIGINT
unsafe {
if signal(Signal::SIGINT, SigHandler::SigDfl).is_ok() {
let _ = raise(Signal::SIGINT);
}
}
}
process::exit(self.into())
}
}
pub fn merge_exitcodes(results: impl IntoIterator<Item = ExitCode>) -> ExitCode {
if results.into_iter().any(ExitCode::is_error) {
return ExitCode::GeneralError;
}
ExitCode::Success
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn success_when_no_results() {
assert_eq!(merge_exitcodes([]), ExitCode::Success);
}
#[test]
fn general_error_if_at_least_one_error() {
assert_eq!(
merge_exitcodes([ExitCode::GeneralError]),
ExitCode::GeneralError
);
assert_eq!(
merge_exitcodes([ExitCode::KilledBySigint]),
ExitCode::GeneralError
);
assert_eq!(
merge_exitcodes([ExitCode::KilledBySigint, ExitCode::Success]),
ExitCode::GeneralError
);
assert_eq!(
merge_exitcodes([ExitCode::Success, ExitCode::GeneralError]),
ExitCode::GeneralError
);
assert_eq!(
merge_exitcodes([ExitCode::GeneralError, ExitCode::KilledBySigint]),
ExitCode::GeneralError
);
}
#[test]
fn success_if_no_error() {
assert_eq!(merge_exitcodes([ExitCode::Success]), ExitCode::Success);
assert_eq!(
merge_exitcodes([ExitCode::Success, ExitCode::Success]),
ExitCode::Success
);
}
}
+156
View File
@@ -0,0 +1,156 @@
use std::borrow::Cow;
use std::env;
use std::ffi::OsStr;
use std::fs;
use std::io;
#[cfg(any(unix, target_os = "redox"))]
use std::os::unix::fs::FileTypeExt;
use std::path::{Path, PathBuf};
use normpath::PathExt;
use crate::dir_entry;
pub fn path_absolute_form(path: &Path) -> io::Result<PathBuf> {
if path.is_absolute() {
return Ok(path.to_path_buf());
}
let path = path.strip_prefix(".").unwrap_or(path);
env::current_dir().map(|path_buf| path_buf.join(path))
}
pub fn absolute_path(path: &Path) -> io::Result<PathBuf> {
let path_buf = path_absolute_form(path)?;
#[cfg(windows)]
let path_buf = Path::new(
path_buf
.as_path()
.to_string_lossy()
.trim_start_matches(r"\\?\"),
)
.to_path_buf();
Ok(path_buf)
}
pub fn is_existing_directory(path: &Path) -> bool {
// Note: we do not use `.exists()` here, as `.` always exists, even if
// the CWD has been deleted.
path.is_dir() && (path.file_name().is_some() || path.normalize().is_ok())
}
pub fn is_empty(entry: &dir_entry::DirEntry) -> bool {
if let Some(file_type) = entry.file_type() {
if file_type.is_dir() {
if let Ok(mut entries) = fs::read_dir(entry.path()) {
entries.next().is_none()
} else {
false
}
} else if file_type.is_file() {
entry.metadata().map(|m| m.len() == 0).unwrap_or(false)
} else {
false
}
} else {
false
}
}
#[cfg(any(unix, target_os = "redox"))]
pub fn is_block_device(ft: fs::FileType) -> bool {
ft.is_block_device()
}
#[cfg(windows)]
pub fn is_block_device(_: fs::FileType) -> bool {
false
}
#[cfg(any(unix, target_os = "redox"))]
pub fn is_char_device(ft: fs::FileType) -> bool {
ft.is_char_device()
}
#[cfg(windows)]
pub fn is_char_device(_: fs::FileType) -> bool {
false
}
#[cfg(any(unix, target_os = "redox"))]
pub fn is_socket(ft: fs::FileType) -> bool {
ft.is_socket()
}
#[cfg(windows)]
pub fn is_socket(_: fs::FileType) -> bool {
false
}
#[cfg(any(unix, target_os = "redox"))]
pub fn is_pipe(ft: fs::FileType) -> bool {
ft.is_fifo()
}
#[cfg(windows)]
pub fn is_pipe(_: fs::FileType) -> bool {
false
}
#[cfg(any(unix, target_os = "redox"))]
pub fn osstr_to_bytes(input: &OsStr) -> Cow<'_, [u8]> {
use std::os::unix::ffi::OsStrExt;
Cow::Borrowed(input.as_bytes())
}
#[cfg(windows)]
pub fn osstr_to_bytes(input: &OsStr) -> Cow<'_, [u8]> {
let string = input.to_string_lossy();
match string {
Cow::Owned(string) => Cow::Owned(string.into_bytes()),
Cow::Borrowed(string) => Cow::Borrowed(string.as_bytes()),
}
}
/// Remove the `./` prefix from a path.
pub fn strip_current_dir(path: &Path) -> &Path {
path.strip_prefix(".").unwrap_or(path)
}
/// Default value for the path_separator, mainly for MSYS/MSYS2, which set the MSYSTEM
/// environment variable, and we set fd's path separator to '/' rather than Rust's default of '\'.
///
/// Returns Some to use a nonstandard path separator, or None to use rust's default on the target
/// platform.
pub fn default_path_separator() -> Option<String> {
if cfg!(windows) {
let msystem = env::var("MSYSTEM").ok()?;
if !msystem.is_empty() {
return Some("/".to_owned());
}
}
None
}
#[cfg(test)]
mod tests {
use super::strip_current_dir;
use std::path::Path;
#[test]
fn strip_current_dir_basic() {
assert_eq!(strip_current_dir(Path::new("./foo")), Path::new("foo"));
assert_eq!(strip_current_dir(Path::new("foo")), Path::new("foo"));
assert_eq!(
strip_current_dir(Path::new("./foo/bar/baz")),
Path::new("foo/bar/baz")
);
assert_eq!(
strip_current_dir(Path::new("foo/bar/baz")),
Path::new("foo/bar/baz")
);
}
}
+43
View File
@@ -0,0 +1,43 @@
use crate::dir_entry;
use crate::filesystem;
use faccess::PathExt;
/// Whether or not to show
#[derive(Default)]
pub struct FileTypes {
pub files: bool,
pub directories: bool,
pub symlinks: bool,
pub block_devices: bool,
pub char_devices: bool,
pub sockets: bool,
pub pipes: bool,
pub executables_only: bool,
pub empty_only: bool,
}
impl FileTypes {
pub fn should_ignore(&self, entry: &dir_entry::DirEntry) -> bool {
if let Some(ref entry_type) = entry.file_type() {
(!self.files && entry_type.is_file())
|| (!self.directories && entry_type.is_dir())
|| (!self.symlinks && entry_type.is_symlink())
|| (!self.block_devices && filesystem::is_block_device(*entry_type))
|| (!self.char_devices && filesystem::is_char_device(*entry_type))
|| (!self.sockets && filesystem::is_socket(*entry_type))
|| (!self.pipes && filesystem::is_pipe(*entry_type))
|| (self.executables_only && !entry.path().executable())
|| (self.empty_only && !filesystem::is_empty(entry))
|| !(entry_type.is_file()
|| entry_type.is_dir()
|| entry_type.is_symlink()
|| filesystem::is_block_device(*entry_type)
|| filesystem::is_char_device(*entry_type)
|| filesystem::is_socket(*entry_type)
|| filesystem::is_pipe(*entry_type))
} else {
true
}
}
}
+11
View File
@@ -0,0 +1,11 @@
pub use self::size::SizeFilter;
pub use self::time::TimeFilter;
#[cfg(unix)]
pub use self::owner::OwnerFilter;
mod size;
mod time;
#[cfg(unix)]
mod owner;
+140
View File
@@ -0,0 +1,140 @@
use anyhow::{Result, anyhow};
use nix::unistd::{Group, User};
use std::fs;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct OwnerFilter {
uid: Check<u32>,
gid: Check<u32>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
enum Check<T> {
Equal(T),
NotEq(T),
Ignore,
}
impl OwnerFilter {
const IGNORE: Self = OwnerFilter {
uid: Check::Ignore,
gid: Check::Ignore,
};
/// Parses an owner constraint
/// Returns an error if the string is invalid
/// Returns Ok(None) when string is acceptable but a noop (such as "" or ":")
pub fn from_string(input: &str) -> Result<Self> {
let mut it = input.split(':');
let (fst, snd) = (it.next(), it.next());
if it.next().is_some() {
return Err(anyhow!(
"more than one ':' present in owner string '{}'. See 'fd --help'.",
input
));
}
let uid = Check::parse(fst, |s| {
if let Ok(uid) = s.parse() {
Ok(uid)
} else {
User::from_name(s)?
.map(|user| user.uid.as_raw())
.ok_or_else(|| anyhow!("'{}' is not a recognized user name", s))
}
})?;
let gid = Check::parse(snd, |s| {
if let Ok(gid) = s.parse() {
Ok(gid)
} else {
Group::from_name(s)?
.map(|group| group.gid.as_raw())
.ok_or_else(|| anyhow!("'{}' is not a recognized group name", s))
}
})?;
Ok(OwnerFilter { uid, gid })
}
/// If self is a no-op (ignore both uid and gid) then return `None`, otherwise wrap in a `Some`
pub fn filter_ignore(self) -> Option<Self> {
if self == Self::IGNORE {
None
} else {
Some(self)
}
}
pub fn matches(&self, md: &fs::Metadata) -> bool {
use std::os::unix::fs::MetadataExt;
self.uid.check(md.uid()) && self.gid.check(md.gid())
}
}
impl<T: PartialEq> Check<T> {
fn check(&self, v: T) -> bool {
match self {
Check::Equal(x) => v == *x,
Check::NotEq(x) => v != *x,
Check::Ignore => true,
}
}
fn parse<F>(s: Option<&str>, f: F) -> Result<Self>
where
F: Fn(&str) -> Result<T>,
{
let (s, equality) = match s {
Some("") | None => return Ok(Check::Ignore),
Some(s) if s.starts_with('!') => (&s[1..], false),
Some(s) => (s, true),
};
f(s).map(|x| {
if equality {
Check::Equal(x)
} else {
Check::NotEq(x)
}
})
}
}
#[cfg(test)]
mod owner_parsing {
use super::OwnerFilter;
macro_rules! owner_tests {
($($name:ident: $value:expr => $result:pat,)*) => {
$(
#[test]
fn $name() {
let o = OwnerFilter::from_string($value);
match o {
$result => {},
_ => panic!("{:?} does not match {}", o, stringify!($result)),
}
}
)*
};
}
use super::Check::*;
owner_tests! {
empty: "" => Ok(OwnerFilter::IGNORE),
uid_only: "5" => Ok(OwnerFilter { uid: Equal(5), gid: Ignore }),
uid_gid: "9:3" => Ok(OwnerFilter { uid: Equal(9), gid: Equal(3) }),
gid_only: ":8" => Ok(OwnerFilter { uid: Ignore, gid: Equal(8) }),
colon_only: ":" => Ok(OwnerFilter::IGNORE),
trailing: "5:" => Ok(OwnerFilter { uid: Equal(5), gid: Ignore }),
uid_negate: "!5" => Ok(OwnerFilter { uid: NotEq(5), gid: Ignore }),
both_negate:"!4:!3" => Ok(OwnerFilter { uid: NotEq(4), gid: NotEq(3) }),
uid_not_gid:"6:!8" => Ok(OwnerFilter { uid: Equal(6), gid: NotEq(8) }),
more_colons:"3:5:" => Err(_),
only_colons:"::" => Err(_),
}
}
+219
View File
@@ -0,0 +1,219 @@
use std::sync::OnceLock;
use anyhow::anyhow;
use regex::Regex;
static SIZE_CAPTURES: OnceLock<Regex> = OnceLock::new();
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SizeFilter {
Max(u64),
Min(u64),
Equals(u64),
}
// SI prefixes (powers of 10)
const KILO: u64 = 1000;
const MEGA: u64 = KILO * 1000;
const GIGA: u64 = MEGA * 1000;
const TERA: u64 = GIGA * 1000;
// Binary prefixes (powers of 2)
const KIBI: u64 = 1024;
const MEBI: u64 = KIBI * 1024;
const GIBI: u64 = MEBI * 1024;
const TEBI: u64 = GIBI * 1024;
impl SizeFilter {
pub fn from_string(s: &str) -> anyhow::Result<Self> {
SizeFilter::parse_opt(s)
.ok_or_else(|| anyhow!("'{}' is not a valid size constraint. See 'fd --help'.", s))
}
fn parse_opt(s: &str) -> Option<Self> {
let pattern =
SIZE_CAPTURES.get_or_init(|| Regex::new(r"(?i)^([+-]?)(\d+)(b|[kmgt]i?b?)$").unwrap());
if !pattern.is_match(s) {
return None;
}
let captures = pattern.captures(s)?;
let limit_kind = captures.get(1).map_or("+", |m| m.as_str());
let quantity = captures
.get(2)
.and_then(|v| v.as_str().parse::<u64>().ok())?;
let multiplier = match &captures.get(3).map_or("b", |m| m.as_str()).to_lowercase()[..] {
v if v.starts_with("ki") => KIBI,
v if v.starts_with('k') => KILO,
v if v.starts_with("mi") => MEBI,
v if v.starts_with('m') => MEGA,
v if v.starts_with("gi") => GIBI,
v if v.starts_with('g') => GIGA,
v if v.starts_with("ti") => TEBI,
v if v.starts_with('t') => TERA,
"b" => 1,
_ => return None,
};
let size = quantity * multiplier;
match limit_kind {
"+" => Some(SizeFilter::Min(size)),
"-" => Some(SizeFilter::Max(size)),
"" => Some(SizeFilter::Equals(size)),
_ => None,
}
}
pub fn is_within(&self, size: u64) -> bool {
match *self {
SizeFilter::Max(limit) => size <= limit,
SizeFilter::Min(limit) => size >= limit,
SizeFilter::Equals(limit) => size == limit,
}
}
}
#[cfg(test)]
mod tests {
use super::*;
macro_rules! gen_size_filter_parse_test {
($($name: ident: $val: expr,)*) => {
$(
#[test]
fn $name() {
let (txt, expected) = $val;
let actual = SizeFilter::from_string(txt).unwrap();
assert_eq!(actual, expected);
}
)*
};
}
// Parsing and size conversion tests data. Ensure that each type gets properly interpreted.
// Call with higher base values to ensure expected multiplication (only need a couple)
gen_size_filter_parse_test! {
byte_plus: ("+1b", SizeFilter::Min(1)),
byte_plus_multiplier: ("+10b", SizeFilter::Min(10)),
byte_minus: ("-1b", SizeFilter::Max(1)),
kilo_plus: ("+1k", SizeFilter::Min(1000)),
kilo_plus_suffix: ("+1kb", SizeFilter::Min(1000)),
kilo_minus: ("-1k", SizeFilter::Max(1000)),
kilo_minus_multiplier: ("-100k", SizeFilter::Max(100_000)),
kilo_minus_suffix: ("-1kb", SizeFilter::Max(1000)),
kilo_plus_upper: ("+1K", SizeFilter::Min(1000)),
kilo_plus_suffix_upper: ("+1KB", SizeFilter::Min(1000)),
kilo_minus_upper: ("-1K", SizeFilter::Max(1000)),
kilo_minus_suffix_upper: ("-1Kb", SizeFilter::Max(1000)),
kibi_plus: ("+1ki", SizeFilter::Min(1024)),
kibi_plus_multiplier: ("+10ki", SizeFilter::Min(10_240)),
kibi_plus_suffix: ("+1kib", SizeFilter::Min(1024)),
kibi_minus: ("-1ki", SizeFilter::Max(1024)),
kibi_minus_multiplier: ("-100ki", SizeFilter::Max(102_400)),
kibi_minus_suffix: ("-1kib", SizeFilter::Max(1024)),
kibi_plus_upper: ("+1KI", SizeFilter::Min(1024)),
kibi_plus_suffix_upper: ("+1KiB", SizeFilter::Min(1024)),
kibi_minus_upper: ("-1Ki", SizeFilter::Max(1024)),
kibi_minus_suffix_upper: ("-1KIB", SizeFilter::Max(1024)),
mega_plus: ("+1m", SizeFilter::Min(1_000_000)),
mega_plus_suffix: ("+1mb", SizeFilter::Min(1_000_000)),
mega_minus: ("-1m", SizeFilter::Max(1_000_000)),
mega_minus_suffix: ("-1mb", SizeFilter::Max(1_000_000)),
mega_plus_upper: ("+1M", SizeFilter::Min(1_000_000)),
mega_plus_suffix_upper: ("+1MB", SizeFilter::Min(1_000_000)),
mega_minus_upper: ("-1M", SizeFilter::Max(1_000_000)),
mega_minus_suffix_upper: ("-1Mb", SizeFilter::Max(1_000_000)),
mebi_plus: ("+1mi", SizeFilter::Min(1_048_576)),
mebi_plus_suffix: ("+1mib", SizeFilter::Min(1_048_576)),
mebi_minus: ("-1mi", SizeFilter::Max(1_048_576)),
mebi_minus_suffix: ("-1mib", SizeFilter::Max(1_048_576)),
mebi_plus_upper: ("+1MI", SizeFilter::Min(1_048_576)),
mebi_plus_suffix_upper: ("+1MiB", SizeFilter::Min(1_048_576)),
mebi_minus_upper: ("-1Mi", SizeFilter::Max(1_048_576)),
mebi_minus_suffix_upper: ("-1MIB", SizeFilter::Max(1_048_576)),
giga_plus: ("+1g", SizeFilter::Min(1_000_000_000)),
giga_plus_suffix: ("+1gb", SizeFilter::Min(1_000_000_000)),
giga_minus: ("-1g", SizeFilter::Max(1_000_000_000)),
giga_minus_suffix: ("-1gb", SizeFilter::Max(1_000_000_000)),
giga_plus_upper: ("+1G", SizeFilter::Min(1_000_000_000)),
giga_plus_suffix_upper: ("+1GB", SizeFilter::Min(1_000_000_000)),
giga_minus_upper: ("-1G", SizeFilter::Max(1_000_000_000)),
giga_minus_suffix_upper: ("-1Gb", SizeFilter::Max(1_000_000_000)),
gibi_plus: ("+1gi", SizeFilter::Min(1_073_741_824)),
gibi_plus_suffix: ("+1gib", SizeFilter::Min(1_073_741_824)),
gibi_minus: ("-1gi", SizeFilter::Max(1_073_741_824)),
gibi_minus_suffix: ("-1gib", SizeFilter::Max(1_073_741_824)),
gibi_plus_upper: ("+1GI", SizeFilter::Min(1_073_741_824)),
gibi_plus_suffix_upper: ("+1GiB", SizeFilter::Min(1_073_741_824)),
gibi_minus_upper: ("-1Gi", SizeFilter::Max(1_073_741_824)),
gibi_minus_suffix_upper: ("-1GIB", SizeFilter::Max(1_073_741_824)),
tera_plus: ("+1t", SizeFilter::Min(1_000_000_000_000)),
tera_plus_suffix: ("+1tb", SizeFilter::Min(1_000_000_000_000)),
tera_minus: ("-1t", SizeFilter::Max(1_000_000_000_000)),
tera_minus_suffix: ("-1tb", SizeFilter::Max(1_000_000_000_000)),
tera_plus_upper: ("+1T", SizeFilter::Min(1_000_000_000_000)),
tera_plus_suffix_upper: ("+1TB", SizeFilter::Min(1_000_000_000_000)),
tera_minus_upper: ("-1T", SizeFilter::Max(1_000_000_000_000)),
tera_minus_suffix_upper: ("-1Tb", SizeFilter::Max(1_000_000_000_000)),
tebi_plus: ("+1ti", SizeFilter::Min(1_099_511_627_776)),
tebi_plus_suffix: ("+1tib", SizeFilter::Min(1_099_511_627_776)),
tebi_minus: ("-1ti", SizeFilter::Max(1_099_511_627_776)),
tebi_minus_suffix: ("-1tib", SizeFilter::Max(1_099_511_627_776)),
tebi_plus_upper: ("+1TI", SizeFilter::Min(1_099_511_627_776)),
tebi_plus_suffix_upper: ("+1TiB", SizeFilter::Min(1_099_511_627_776)),
tebi_minus_upper: ("-1Ti", SizeFilter::Max(1_099_511_627_776)),
tebi_minus_suffix_upper: ("-1TIB", SizeFilter::Max(1_099_511_627_776)),
}
/// Invalid parse testing
macro_rules! gen_size_filter_failure {
($($name:ident: $value:expr,)*) => {
$(
#[test]
fn $name() {
let i = SizeFilter::from_string($value);
assert!(i.is_err());
}
)*
};
}
// Invalid parse data
gen_size_filter_failure! {
ensure_missing_number_returns_none: "+g",
ensure_missing_unit_returns_none: "+18",
ensure_bad_format_returns_none_1: "$10M",
ensure_bad_format_returns_none_2: "badval",
ensure_bad_format_returns_none_3: "9999",
ensure_invalid_unit_returns_none_1: "+50a",
ensure_invalid_unit_returns_none_2: "-10v",
ensure_invalid_unit_returns_none_3: "+1Mv",
ensure_bib_format_returns_none: "+1bib",
ensure_bb_format_returns_none: "+1bb",
}
#[test]
fn is_within_less_than() {
let f = SizeFilter::from_string("-1k").unwrap();
assert!(f.is_within(999));
}
#[test]
fn is_within_less_than_equal() {
let f = SizeFilter::from_string("-1k").unwrap();
assert!(f.is_within(1000));
}
#[test]
fn is_within_greater_than() {
let f = SizeFilter::from_string("+1k").unwrap();
assert!(f.is_within(1001));
}
#[test]
fn is_within_greater_than_equal() {
let f = SizeFilter::from_string("+1K").unwrap();
assert!(f.is_within(1000));
}
}
+210
View File
@@ -0,0 +1,210 @@
use jiff::{Span, Timestamp, Zoned, civil::DateTime, tz::TimeZone};
use std::time::{Duration, SystemTime, UNIX_EPOCH};
/// Filter based on time ranges.
#[derive(Debug, PartialEq, Eq)]
pub enum TimeFilter {
Before(SystemTime),
After(SystemTime),
}
#[cfg(not(test))]
fn now() -> Zoned {
Zoned::now()
}
#[cfg(test)]
thread_local! {
static TESTTIME: std::cell::RefCell<Option<Zoned>> = None.into();
}
/// This allows us to set a specific time when running tests
#[cfg(test)]
fn now() -> Zoned {
TESTTIME.with_borrow(|reftime| reftime.as_ref().cloned().unwrap_or_else(Zoned::now))
}
impl TimeFilter {
fn from_str(s: &str) -> Option<SystemTime> {
if let Ok(span) = s.parse::<Span>() {
let datetime = now().checked_sub(span).ok()?;
Some(datetime.into())
} else if let Ok(timestamp) = s.parse::<Timestamp>() {
Some(timestamp.into())
} else if let Ok(datetime) = s.parse::<DateTime>() {
Some(
TimeZone::system()
.to_ambiguous_zoned(datetime)
.later()
.ok()?
.into(),
)
} else {
let timestamp_secs: u64 = s.strip_prefix('@')?.parse().ok()?;
UNIX_EPOCH.checked_add(Duration::from_secs(timestamp_secs))
}
}
pub fn before(s: &str) -> Option<TimeFilter> {
TimeFilter::from_str(s).map(TimeFilter::Before)
}
pub fn after(s: &str) -> Option<TimeFilter> {
TimeFilter::from_str(s).map(TimeFilter::After)
}
pub fn applies_to(&self, t: &SystemTime) -> bool {
match self {
TimeFilter::Before(limit) => t < limit,
TimeFilter::After(limit) => t > limit,
}
}
}
#[cfg(test)]
mod tests {
use super::*;
use std::time::Duration;
struct TestTime(SystemTime);
impl TestTime {
fn new(time: Zoned) -> Self {
TESTTIME.with_borrow_mut(|t| *t = Some(time.clone()));
TestTime(time.into())
}
fn set(&mut self, time: Zoned) {
TESTTIME.with_borrow_mut(|t| *t = Some(time.clone()));
self.0 = time.into();
}
fn timestamp(&self) -> SystemTime {
self.0
}
}
impl Drop for TestTime {
fn drop(&mut self) {
// Stop using manually set times
TESTTIME.with_borrow_mut(|t| *t = None);
}
}
#[test]
fn is_time_filter_applicable() {
let local_tz = TimeZone::system();
let mut test_time = TestTime::new(
local_tz
.to_ambiguous_zoned("2010-10-10 10:10:10".parse::<DateTime>().unwrap())
.later()
.unwrap(),
);
let mut ref_time = test_time.timestamp();
assert!(TimeFilter::after("1min").unwrap().applies_to(&ref_time));
assert!(!TimeFilter::before("1min").unwrap().applies_to(&ref_time));
let t1m_ago = ref_time - Duration::from_secs(60);
assert!(!TimeFilter::after("30sec").unwrap().applies_to(&t1m_ago));
assert!(TimeFilter::after("2min").unwrap().applies_to(&t1m_ago));
assert!(TimeFilter::before("30sec").unwrap().applies_to(&t1m_ago));
assert!(!TimeFilter::before("2min").unwrap().applies_to(&t1m_ago));
let t10s_before = "2010-10-10 10:10:00";
assert!(
!TimeFilter::before(t10s_before)
.unwrap()
.applies_to(&ref_time)
);
assert!(
TimeFilter::before(t10s_before)
.unwrap()
.applies_to(&t1m_ago)
);
assert!(
TimeFilter::after(t10s_before)
.unwrap()
.applies_to(&ref_time)
);
assert!(!TimeFilter::after(t10s_before).unwrap().applies_to(&t1m_ago));
let same_day = "2010-10-10";
assert!(!TimeFilter::before(same_day).unwrap().applies_to(&ref_time));
assert!(!TimeFilter::before(same_day).unwrap().applies_to(&t1m_ago));
assert!(TimeFilter::after(same_day).unwrap().applies_to(&ref_time));
assert!(TimeFilter::after(same_day).unwrap().applies_to(&t1m_ago));
test_time.set(
"2010-10-10T10:10:10+00:00"
.parse::<Timestamp>()
.unwrap()
.to_zoned(local_tz.clone()),
);
ref_time = test_time.timestamp();
let t1m_ago = ref_time - Duration::from_secs(60);
let t10s_before = "2010-10-10T10:10:00+00:00";
assert!(
!TimeFilter::before(t10s_before)
.unwrap()
.applies_to(&ref_time)
);
assert!(
TimeFilter::before(t10s_before)
.unwrap()
.applies_to(&t1m_ago)
);
assert!(
TimeFilter::after(t10s_before)
.unwrap()
.applies_to(&ref_time)
);
assert!(!TimeFilter::after(t10s_before).unwrap().applies_to(&t1m_ago));
let ref_timestamp = 1707723412u64; // Mon Feb 12 07:36:52 UTC 2024
test_time.set(
"2024-02-12T07:36:52+00:00"
.parse::<Timestamp>()
.unwrap()
.to_zoned(local_tz),
);
ref_time = test_time.timestamp();
let t1m_ago = ref_time - Duration::from_secs(60);
let t1s_later = ref_time + Duration::from_secs(1);
// Timestamp only supported via '@' prefix
assert!(TimeFilter::before(&ref_timestamp.to_string()).is_none());
assert!(
TimeFilter::before(&format!("@{ref_timestamp}"))
.unwrap()
.applies_to(&t1m_ago)
);
assert!(
!TimeFilter::before(&format!("@{ref_timestamp}"))
.unwrap()
.applies_to(&t1s_later)
);
assert!(
!TimeFilter::after(&format!("@{ref_timestamp}"))
.unwrap()
.applies_to(&t1m_ago)
);
assert!(
TimeFilter::after(&format!("@{ref_timestamp}"))
.unwrap()
.applies_to(&t1s_later)
);
}
#[test]
fn out_of_range_unix_timestamp_is_rejected() {
// A '@' timestamp large enough to overflow SystemTime must return
// None rather than panicking.
assert!(TimeFilter::before(&format!("@{}", u64::MAX)).is_none());
assert!(TimeFilter::after(&format!("@{}", u64::MAX)).is_none());
}
}
+87
View File
@@ -0,0 +1,87 @@
use std::ffi::{OsStr, OsString};
use std::path::{Path, PathBuf};
use crate::filesystem::strip_current_dir;
/// Removes the parent component of the path
pub fn basename(path: &Path) -> &OsStr {
path.file_name().unwrap_or(path.as_os_str())
}
/// Removes the extension from the path
pub fn remove_extension(path: &Path) -> OsString {
let dirname = dirname(path);
let stem = path.file_stem().unwrap_or(path.as_os_str());
let path = PathBuf::from(dirname).join(stem);
strip_current_dir(&path).to_owned().into_os_string()
}
/// Removes the basename from the path.
pub fn dirname(path: &Path) -> OsString {
path.parent()
.map(|p| {
if p == OsStr::new("") {
OsString::from(".")
} else {
p.as_os_str().to_owned()
}
})
.unwrap_or_else(|| path.as_os_str().to_owned())
}
#[cfg(test)]
mod path_tests {
use super::*;
use std::path::MAIN_SEPARATOR_STR;
fn correct(input: &str) -> String {
input.replace('/', MAIN_SEPARATOR_STR)
}
macro_rules! func_tests {
($($name:ident: $func:ident for $input:expr => $output:expr)+) => {
$(
#[test]
fn $name() {
let input_path = PathBuf::from(&correct($input));
let output_string = OsString::from(correct($output));
assert_eq!($func(&input_path), output_string);
}
)+
}
}
func_tests! {
remove_ext_simple: remove_extension for "foo.txt" => "foo"
remove_ext_dir: remove_extension for "dir/foo.txt" => "dir/foo"
hidden: remove_extension for ".foo" => ".foo"
remove_ext_utf8: remove_extension for "💖.txt" => "💖"
remove_ext_empty: remove_extension for "" => ""
basename_simple: basename for "foo.txt" => "foo.txt"
basename_dir: basename for "dir/foo.txt" => "foo.txt"
basename_empty: basename for "" => ""
basename_utf8_0: basename for "💖/foo.txt" => "foo.txt"
basename_utf8_1: basename for "dir/💖.txt" => "💖.txt"
dirname_simple: dirname for "foo.txt" => "."
dirname_dir: dirname for "dir/foo.txt" => "dir"
dirname_utf8_0: dirname for "💖/foo.txt" => "💖"
dirname_utf8_1: dirname for "dir/💖.txt" => "dir"
}
#[test]
#[cfg(windows)]
fn dirname_root() {
assert_eq!(dirname(&PathBuf::from("C:")), OsString::from("C:"));
assert_eq!(dirname(&PathBuf::from("\\")), OsString::from("\\"));
}
#[test]
#[cfg(not(windows))]
fn dirname_root() {
assert_eq!(dirname(&PathBuf::from("/")), OsString::from("/"));
}
}
+281
View File
@@ -0,0 +1,281 @@
mod input;
use std::borrow::Cow;
use std::ffi::{OsStr, OsString};
use std::fmt::{self, Display, Formatter};
use std::path::{Component, Path, Prefix};
use std::sync::OnceLock;
use aho_corasick::AhoCorasick;
use self::input::{basename, dirname, remove_extension};
/// Designates what should be written to a buffer
///
/// Each `Token` contains either text, or a placeholder variant, which will be used to generate
/// commands after all tokens for a given command template have been collected.
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Token {
Placeholder,
Basename,
Parent,
NoExt,
BasenameNoExt,
Text(String),
}
impl Display for Token {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
match *self {
Token::Placeholder => f.write_str("{}")?,
Token::Basename => f.write_str("{/}")?,
Token::Parent => f.write_str("{//}")?,
Token::NoExt => f.write_str("{.}")?,
Token::BasenameNoExt => f.write_str("{/.}")?,
Token::Text(ref string) => f.write_str(string)?,
}
Ok(())
}
}
/// A parsed format string
///
/// This is either a collection of `Token`s including at least one placeholder variant,
/// or a fixed text.
#[derive(Clone, Debug, PartialEq)]
pub enum FormatTemplate {
Tokens(Vec<Token>),
Text(String),
}
static PLACEHOLDERS: OnceLock<AhoCorasick> = OnceLock::new();
impl FormatTemplate {
pub fn has_tokens(&self) -> bool {
matches!(self, FormatTemplate::Tokens(_))
}
pub fn parse(fmt: &str) -> Self {
// NOTE: we assume that { and } have the same length
const BRACE_LEN: usize = '{'.len_utf8();
let mut tokens = Vec::new();
let mut remaining = fmt;
let mut buf = String::new();
let placeholders = PLACEHOLDERS.get_or_init(|| {
AhoCorasick::new(["{{", "}}", "{}", "{/}", "{//}", "{.}", "{/.}"]).unwrap()
});
while let Some(m) = placeholders.find(remaining) {
match m.pattern().as_u32() {
0 | 1 => {
// we found an escaped {{ or }}, so add
// everything up to the first char to the buffer
// then skip the second one.
buf += &remaining[..m.start() + BRACE_LEN];
remaining = &remaining[m.end()..];
}
id if !remaining[m.end()..].starts_with('}') => {
buf += &remaining[..m.start()];
if !buf.is_empty() {
tokens.push(Token::Text(std::mem::take(&mut buf)));
}
tokens.push(token_from_pattern_id(id));
remaining = &remaining[m.end()..];
}
_ => {
// We got a normal pattern, but the final "}"
// is escaped, so add up to that to the buffer, then
// skip the final }
buf += &remaining[..m.end()];
remaining = &remaining[m.end() + BRACE_LEN..];
}
}
}
// Add the rest of the string to the buffer, and add the final buffer to the tokens
if !remaining.is_empty() {
buf += remaining;
}
if tokens.is_empty() {
// No placeholders were found, so just return the text
return FormatTemplate::Text(buf);
}
// Add final text segment
if !buf.is_empty() {
tokens.push(Token::Text(buf));
}
debug_assert!(!tokens.is_empty());
FormatTemplate::Tokens(tokens)
}
/// Generate a result string from this template. If path_separator is Some, then it will replace
/// the path separator in all placeholder tokens. Fixed text and tokens are not affected by
/// path separator substitution.
pub fn generate(&self, path: impl AsRef<Path>, path_separator: Option<&str>) -> OsString {
use Token::*;
let path = path.as_ref();
match *self {
Self::Tokens(ref tokens) => {
let mut s = OsString::new();
for token in tokens {
match token {
Basename => s.push(Self::replace_separator(basename(path), path_separator)),
BasenameNoExt => s.push(Self::replace_separator(
&remove_extension(basename(path).as_ref()),
path_separator,
)),
NoExt => s.push(Self::replace_separator(
&remove_extension(path),
path_separator,
)),
Parent => s.push(Self::replace_separator(&dirname(path), path_separator)),
Placeholder => {
s.push(Self::replace_separator(path.as_ref(), path_separator))
}
Text(string) => s.push(string),
}
}
s
}
Self::Text(ref text) => OsString::from(text),
}
}
/// Replace the path separator in the input with the custom separator string. If path_separator
/// is None, simply return a borrowed Cow<OsStr> of the input. Otherwise, the input is
/// interpreted as a Path and its components are iterated through and re-joined into a new
/// OsString.
fn replace_separator<'a>(path: &'a OsStr, path_separator: Option<&str>) -> Cow<'a, OsStr> {
// fast-path - no replacement necessary
if path_separator.is_none() {
return Cow::Borrowed(path);
}
let path_separator = path_separator.unwrap();
let mut out = OsString::with_capacity(path.len());
let mut components = Path::new(path).components().peekable();
while let Some(comp) = components.next() {
match comp {
// Absolute paths on Windows are tricky. A Prefix component is usually a drive
// letter or UNC path, and is usually followed by RootDir. There are also
// "verbatim" prefixes beginning with "\\?\" that skip normalization. We choose to
// ignore verbatim path prefixes here because they're very rare, might be
// impossible to reach here, and there's no good way to deal with them. If users
// are doing something advanced involving verbatim windows paths, they can do their
// own output filtering with a tool like sed.
Component::Prefix(prefix) => {
if let Prefix::UNC(server, share) = prefix.kind() {
// Prefix::UNC is a parsed version of '\\server\share'
out.push(path_separator);
out.push(path_separator);
out.push(server);
out.push(path_separator);
out.push(share);
} else {
// All other Windows prefix types are rendered as-is. This results in e.g. "C:" for
// drive letters. DeviceNS and Verbatim* prefixes won't have backslashes converted,
// but they're not returned by directories fd can search anyway so we don't worry
// about them.
out.push(comp.as_os_str());
}
}
// Root directory is always replaced with the custom separator.
Component::RootDir => out.push(path_separator),
// Everything else is joined normally, with a trailing separator if we're not last
_ => {
out.push(comp.as_os_str());
if components.peek().is_some() {
out.push(path_separator);
}
}
}
}
Cow::Owned(out)
}
}
// Convert the id from an aho-corasick match to the
// appropriate token
fn token_from_pattern_id(id: u32) -> Token {
use Token::*;
match id {
2 => Placeholder,
3 => Basename,
4 => Parent,
5 => NoExt,
6 => BasenameNoExt,
_ => unreachable!(),
}
}
#[cfg(test)]
mod fmt_tests {
use super::*;
use std::path::PathBuf;
#[test]
fn parse_no_placeholders() {
let templ = FormatTemplate::parse("This string has no placeholders");
assert_eq!(
templ,
FormatTemplate::Text("This string has no placeholders".into())
);
}
#[test]
fn parse_only_brace_escapes() {
let templ = FormatTemplate::parse("This string only has escapes like {{ and }}");
assert_eq!(
templ,
FormatTemplate::Text("This string only has escapes like { and }".into())
);
}
#[test]
fn all_placeholders() {
use Token::*;
let templ = FormatTemplate::parse(
"{{path={} \
basename={/} \
parent={//} \
noExt={.} \
basenameNoExt={/.} \
}}",
);
assert_eq!(
templ,
FormatTemplate::Tokens(vec![
Text("{path=".into()),
Placeholder,
Text(" basename=".into()),
Basename,
Text(" parent=".into()),
Parent,
Text(" noExt=".into()),
NoExt,
Text(" basenameNoExt=".into()),
BasenameNoExt,
Text(" }".into()),
])
);
let mut path = PathBuf::new();
path.push("a");
path.push("folder");
path.push("file.txt");
let expanded = templ.generate(&path, Some("/")).into_string().unwrap();
assert_eq!(
expanded,
"{path=a/folder/file.txt \
basename=file.txt \
parent=a/folder \
noExt=a/folder/file \
basenameNoExt=file }"
);
}
}
-43
View File
@@ -1,43 +0,0 @@
use std::path::{Path, PathBuf};
/// Get a relative path with respect to a certain base path.
/// See: https://stackoverflow.com/a/39343127/704831
pub fn path_relative_from(path: &Path, base: &Path) -> Option<PathBuf> {
use std::path::Component;
if path.is_absolute() != base.is_absolute() {
if path.is_absolute() {
Some(PathBuf::from(path))
} else {
None
}
} else {
let mut ita = path.components();
let mut itb = base.components();
let mut comps: Vec<Component> = vec![];
loop {
match (ita.next(), itb.next()) {
(None, None) => break,
(Some(a), None) => {
comps.push(a);
comps.extend(ita.by_ref());
break;
}
(None, _) => comps.push(Component::ParentDir),
(Some(a), Some(b)) if comps.is_empty() && a == b => (),
(Some(a), Some(b)) if b == Component::CurDir => comps.push(a),
(Some(_), Some(b)) if b == Component::ParentDir => return None,
(Some(a), Some(_)) => {
comps.push(Component::ParentDir);
for _ in itb {
comps.push(Component::ParentDir);
}
comps.push(a);
comps.extend(ita.by_ref());
break;
}
}
}
Some(comps.iter().map(|c| c.as_os_str()).collect())
}
}
+87
View File
@@ -0,0 +1,87 @@
use crate::filesystem::absolute_path;
use std::fmt::{self, Formatter, Write};
use std::path::{Path, PathBuf};
pub(crate) struct PathUrl(PathBuf);
impl PathUrl {
pub(crate) fn new(path: &Path) -> Option<PathUrl> {
Some(PathUrl(absolute_path(path).ok()?))
}
}
impl fmt::Display for PathUrl {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
write!(f, "file://{}", host())?;
let bytes = self.0.as_os_str().as_encoded_bytes();
for &byte in bytes.iter() {
encode(f, byte)?;
}
Ok(())
}
}
fn encode(f: &mut Formatter, byte: u8) -> fmt::Result {
// NOTE:
// Most terminals can handle non-ascii unicode characters in a file url fine. But on some OSes (notably
// windows), the encoded bytes of the path may not be valid UTF-8. Since we don't know if a
// byte >= 128 is part of a valid UTF-8 encoding or not, we just percent encode any non-ascii
// byte.
// Percent encoding these bytes is probably safer anyway.
match byte {
b'0'..=b'9' | b'A'..=b'Z' | b'a'..=b'z' | b'/' | b':' | b'-' | b'.' | b'_' | b'~' => {
f.write_char(byte.into())
}
#[cfg(windows)]
b'\\' => f.write_char('/'),
_ => {
write!(f, "%{byte:02X}")
}
}
}
#[cfg(unix)]
fn host() -> &'static str {
use std::sync::OnceLock;
static HOSTNAME: OnceLock<String> = OnceLock::new();
HOSTNAME
.get_or_init(|| {
nix::unistd::gethostname()
.ok()
.and_then(|h| h.into_string().ok())
.unwrap_or_default()
})
.as_ref()
}
#[cfg(not(unix))]
const fn host() -> &'static str {
"/"
}
#[cfg(test)]
mod test {
use super::*;
// This allows us to test the encoding without having to worry about the host, or absolute path
struct Encoded(&'static str);
impl fmt::Display for Encoded {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
for byte in self.0.bytes() {
encode(f, byte)?;
}
Ok(())
}
}
#[test]
fn test_unicode_encoding() {
assert_eq!(
Encoded("$*\x1bßé/∫😃\x07").to_string(),
"%24%2A%1B%C3%9F%C3%A9/%E2%88%AB%F0%9F%98%83%07",
);
}
}
-219
View File
@@ -1,219 +0,0 @@
/// A parser for the `LS_COLORS` environment variable.
use std::collections::HashMap;
use ansi_term::{Style, Colour};
/// Maps file extensions to ANSI colors / styles.
pub type ExtensionStyles = HashMap<String, Style>;
/// Maps filenames to ANSI colors / styles.
pub type FilenameStyles = HashMap<String, Style>;
const LS_CODES: &'static [&'static str] =
&["no", "no", "fi", "rs", "di", "ln", "ln", "ln", "or", "mi", "pi", "pi",
"so", "bd", "bd", "cd", "cd", "do", "ex", "lc", "lc", "rc", "rc", "ec",
"ec", "su", "su", "sg", "sg", "st", "ow", "ow", "tw", "tw", "ca", "mh",
"cl"];
/// Defines how different file system entries should be colorized / styled.
#[derive(Debug, PartialEq)]
pub struct LsColors {
/// ANSI Style for directories.
pub directory: Style,
/// ANSI style for symbolic links.
pub symlink: Style,
/// ANSI style for executable files.
pub executable: Style,
/// A map that defines ANSI styles for different file extensions.
pub extensions: ExtensionStyles,
/// A map that defines ANSI styles for different specific filenames.
pub filenames: FilenameStyles,
}
impl Default for LsColors {
/// Get a default LsColors structure.
fn default() -> LsColors {
LsColors {
directory: Colour::Blue.bold(),
symlink: Colour::Cyan.normal(),
executable: Colour::Red.bold(),
extensions: HashMap::new(),
filenames: HashMap::new()
}
}
}
impl LsColors {
/// Parse a single text-decoration code (normal, bold, italic, ...).
fn parse_decoration(code: &str) -> Option<fn(Colour) -> Style> {
match code {
"0" | "00" => Some(Colour::normal),
"1" | "01" => Some(Colour::bold),
"3" | "03" => Some(Colour::italic),
"4" | "04" => Some(Colour::underline),
_ => None
}
}
/// Parse ANSI escape sequences like `38;5;10;1`.
fn parse_style(code: &str) -> Option<Style> {
let mut split = code.split(';');
if let Some(first) = split.next() {
// Try to match the first part as a text-decoration argument
let mut decoration = LsColors::parse_decoration(first);
let c1 = if decoration.is_none() { Some(first) } else { split.next() };
let c2 = split.next();
let c3 = split.next();
let color =
if c1 == Some("38") && c2 == Some("5") {
let n_white = 7;
let n = if let Some(num) = c3 {
u8::from_str_radix(num, 10).unwrap_or(n_white)
} else {
n_white
};
Colour::Fixed(n)
} else if let Some(color_s) = c1 {
match color_s {
"30" => Colour::Black,
"31" => Colour::Red,
"32" => Colour::Green,
"33" => Colour::Yellow,
"34" => Colour::Blue,
"35" => Colour::Purple,
"36" => Colour::Cyan,
_ => Colour::White
}
} else {
Colour::White
};
if decoration.is_none() {
// Try to find a decoration somewhere in the sequence
decoration = code.split(';')
.flat_map(LsColors::parse_decoration)
.next();
}
let ansi_style = decoration.unwrap_or(Colour::normal)(color);
Some(ansi_style)
} else {
None
}
}
/// Add a new `LS_COLORS` entry.
fn add_entry(&mut self, input: &str) {
let mut parts = input.trim().split('=');
if let Some(pattern) = parts.next() {
if let Some(style_code) = parts.next() {
// Ensure that the input was split into exactly two parts:
if !parts.next().is_none() {
return;
}
if let Some(style) = LsColors::parse_style(style_code) {
// Try to match against one of the known codes
let res = LS_CODES.iter().find(|&&c| c == pattern);
if let Some(code) = res {
match code.as_ref() {
"di" => self.directory = style,
"ln" => self.symlink = style,
"ex" => self.executable = style,
_ => return
}
} else if pattern.starts_with("*.") {
let extension = String::from(pattern).split_off(2);
self.extensions.insert(extension, style);
}
else if pattern.starts_with('*') {
let filename = String::from(pattern).split_off(1);
self.filenames.insert(filename, style);
} else {
// Unknown/corrupt pattern
return;
}
}
}
}
}
/// Generate a `LsColors` structure from a string.
pub fn from_string(input: &str) -> LsColors {
let mut lscolors = LsColors::default();
for s in input.split(':') {
lscolors.add_entry(s);
}
lscolors
}
}
#[test]
fn test_parse_simple() {
assert_eq!(Some(Colour::Red.normal()),
LsColors::parse_style("31"));
}
#[test]
fn test_parse_decoration() {
assert_eq!(Some(Colour::Red.normal()),
LsColors::parse_style("00;31"));
assert_eq!(Some(Colour::Blue.italic()),
LsColors::parse_style("03;34"));
assert_eq!(Some(Colour::Cyan.bold()),
LsColors::parse_style("01;36"));
}
#[test]
fn test_parse_decoration_backwards() {
assert_eq!(Some(Colour::Blue.italic()),
LsColors::parse_style("34;03"));
assert_eq!(Some(Colour::Cyan.bold()),
LsColors::parse_style("36;01"));
assert_eq!(Some(Colour::Red.normal()),
LsColors::parse_style("31;00"));
}
#[test]
fn test_parse_256() {
assert_eq!(Some(Colour::Fixed(115).normal()),
LsColors::parse_style("38;5;115"));
assert_eq!(Some(Colour::Fixed(115).normal()),
LsColors::parse_style("00;38;5;115"));
assert_eq!(Some(Colour::Fixed(119).bold()),
LsColors::parse_style("01;38;5;119"));
assert_eq!(Some(Colour::Fixed(119).bold()),
LsColors::parse_style("38;5;119;01"));
}
#[test]
fn test_from_string() {
assert_eq!(LsColors::default(), LsColors::from_string(&String::new()));
let result = LsColors::from_string(
&String::from("rs=0:di=03;34:ln=01;36:*.foo=01;35:*README=33"));
assert_eq!(Colour::Blue.italic(), result.directory);
assert_eq!(Colour::Cyan.bold(), result.symlink);
assert_eq!(Some(&Colour::Purple.bold()), result.extensions.get("foo"));
assert_eq!(Some(&Colour::Yellow.normal()), result.filenames.get("README"));
}
+543 -492
View File
File diff suppressed because it is too large Load Diff
+182
View File
@@ -0,0 +1,182 @@
use std::borrow::Cow;
use std::io::{self, Write};
use lscolors::{Indicator, LsColors, Style};
use crate::config::Config;
use crate::dir_entry::DirEntry;
use crate::fmt::FormatTemplate;
use crate::hyperlink::PathUrl;
use crate::sanitize::maybe_sanitize;
fn replace_path_separator(path: &str, new_path_separator: &str) -> String {
path.replace(std::path::MAIN_SEPARATOR, new_path_separator)
}
// TODO: this function is performance critical and can probably be optimized
pub fn print_entry<W: Write>(stdout: &mut W, entry: &DirEntry, config: &Config) -> io::Result<()> {
let mut has_hyperlink = false;
if config.hyperlink
&& let Some(url) = PathUrl::new(entry.path())
{
write!(stdout, "\x1B]8;;{url}\x1B\\")?;
has_hyperlink = true;
}
if let Some(ref format) = config.format {
print_entry_format(stdout, entry, config, format)?;
} else if let Some(ref ls_colors) = config.ls_colors {
print_entry_colorized(stdout, entry, config, ls_colors)?;
} else {
print_entry_uncolorized(stdout, entry, config)?;
};
if has_hyperlink {
write!(stdout, "\x1B]8;;\x1B\\")?;
}
if config.null_separator {
write!(stdout, "\0")
} else {
writeln!(stdout)
}
}
// Display a trailing slash if the path is a directory and the config option is enabled.
// If the path_separator option is set, display that instead.
// The trailing slash will not be colored.
#[inline]
fn print_trailing_slash<W: Write>(
stdout: &mut W,
entry: &DirEntry,
config: &Config,
style: Option<&Style>,
) -> io::Result<()> {
if entry.file_type().is_some_and(|ft| ft.is_dir()) {
write!(
stdout,
"{}",
style
.map(Style::to_nu_ansi_term_style)
.unwrap_or_default()
.paint(&config.actual_path_separator)
)?;
}
Ok(())
}
// TODO: this function is performance critical and can probably be optimized
fn print_entry_format<W: Write>(
stdout: &mut W,
entry: &DirEntry,
config: &Config,
format: &FormatTemplate,
) -> io::Result<()> {
let output = format.generate(
entry.stripped_path(config),
config.path_separator.as_deref(),
);
// TODO: support writing raw bytes on unix?
let s = output.to_string_lossy();
write!(
stdout,
"{}",
maybe_sanitize(&s, config.interactive_terminal)
)
}
// TODO: this function is performance critical and can probably be optimized
fn print_entry_colorized<W: Write>(
stdout: &mut W,
entry: &DirEntry,
config: &Config,
ls_colors: &LsColors,
) -> io::Result<()> {
let mut offset = 0;
let path = entry.stripped_path(config);
let path_str = path.to_string_lossy();
if let Some(parent) = path.parent() {
offset = parent.to_string_lossy().len();
for c in path_str[offset..].chars() {
if std::path::is_separator(c) {
offset += c.len_utf8();
} else {
break;
}
}
}
if offset > 0 {
let mut parent_str = Cow::from(&path_str[..offset]);
if let Some(ref separator) = config.path_separator {
*parent_str.to_mut() = replace_path_separator(&parent_str, separator);
}
let style = ls_colors
.style_for_indicator(Indicator::Directory)
.map(Style::to_nu_ansi_term_style)
.unwrap_or_default();
let safe_parent = maybe_sanitize(&parent_str, config.interactive_terminal);
write!(stdout, "{}", style.paint(safe_parent.as_ref()))?;
}
let style = entry
.style(ls_colors)
.map(Style::to_nu_ansi_term_style)
.unwrap_or_default();
let safe_basename = maybe_sanitize(&path_str[offset..], config.interactive_terminal);
write!(stdout, "{}", style.paint(safe_basename.as_ref()))?;
print_trailing_slash(
stdout,
entry,
config,
ls_colors.style_for_indicator(Indicator::Directory),
)?;
Ok(())
}
// TODO: this function is performance critical and can probably be optimized
fn print_entry_uncolorized_base<W: Write>(
stdout: &mut W,
entry: &DirEntry,
config: &Config,
) -> io::Result<()> {
let path = entry.stripped_path(config);
let mut path_string = path.to_string_lossy();
if let Some(ref separator) = config.path_separator {
*path_string.to_mut() = replace_path_separator(&path_string, separator);
}
let safe = maybe_sanitize(&path_string, config.interactive_terminal);
write!(stdout, "{safe}")?;
print_trailing_slash(stdout, entry, config, None)
}
#[cfg(not(unix))]
fn print_entry_uncolorized<W: Write>(
stdout: &mut W,
entry: &DirEntry,
config: &Config,
) -> io::Result<()> {
print_entry_uncolorized_base(stdout, entry, config)
}
#[cfg(unix)]
fn print_entry_uncolorized<W: Write>(
stdout: &mut W,
entry: &DirEntry,
config: &Config,
) -> io::Result<()> {
use std::os::unix::ffi::OsStrExt;
if config.interactive_terminal || config.path_separator.is_some() {
print_entry_uncolorized_base(stdout, entry, config)
} else {
// Piped output: raw bytes so invalid UTF-8 filenames reach downstream tools intact.
stdout.write_all(entry.stripped_path(config).as_os_str().as_bytes())?;
print_trailing_slash(stdout, entry, config, None)
}
}
+105
View File
@@ -0,0 +1,105 @@
use regex_syntax::ParserBuilder;
use regex_syntax::hir::Hir;
/// Determine if a regex pattern contains a literal uppercase character.
pub fn pattern_has_uppercase_char(pattern: &str) -> bool {
let mut parser = ParserBuilder::new().utf8(false).build();
parser
.parse(pattern)
.map(|hir| hir_has_uppercase_char(&hir))
.unwrap_or(false)
}
/// Determine if a regex expression contains a literal uppercase character.
fn hir_has_uppercase_char(hir: &Hir) -> bool {
use regex_syntax::hir::*;
match hir.kind() {
HirKind::Literal(Literal(bytes)) => match std::str::from_utf8(bytes) {
Ok(s) => s.chars().any(|c| c.is_uppercase()),
Err(_) => bytes.iter().any(|b| char::from(*b).is_uppercase()),
},
HirKind::Class(Class::Unicode(ranges)) => ranges
.iter()
.any(|r| r.start().is_uppercase() || r.end().is_uppercase()),
HirKind::Class(Class::Bytes(ranges)) => ranges
.iter()
.any(|r| char::from(r.start()).is_uppercase() || char::from(r.end()).is_uppercase()),
HirKind::Capture(Capture { sub, .. }) | HirKind::Repetition(Repetition { sub, .. }) => {
hir_has_uppercase_char(sub)
}
HirKind::Concat(hirs) | HirKind::Alternation(hirs) => {
hirs.iter().any(hir_has_uppercase_char)
}
_ => false,
}
}
/// Determine if a regex pattern only matches strings starting with a literal dot (hidden files)
pub fn pattern_matches_strings_with_leading_dot(pattern: &str) -> bool {
let mut parser = ParserBuilder::new().utf8(false).build();
parser
.parse(pattern)
.map(|hir| hir_matches_strings_with_leading_dot(&hir))
.unwrap_or(false)
}
/// See above.
fn hir_matches_strings_with_leading_dot(hir: &Hir) -> bool {
use regex_syntax::hir::*;
// Note: this only really detects the simplest case where a regex starts with
// "^\\.", i.e. a start text anchor and a literal dot character. There are a lot
// of other patterns that ONLY match hidden files, e.g. ^(\\.foo|\\.bar) which are
// not (yet) detected by this algorithm.
match hir.kind() {
HirKind::Concat(hirs) => {
let mut hirs = hirs.iter();
if let Some(hir) = hirs.next() {
if hir.kind() != &HirKind::Look(Look::Start) {
return false;
}
} else {
return false;
}
if let Some(hir) = hirs.next() {
match hir.kind() {
HirKind::Literal(Literal(bytes)) => bytes.starts_with(b"."),
_ => false,
}
} else {
false
}
}
_ => false,
}
}
#[test]
fn pattern_has_uppercase_char_simple() {
assert!(pattern_has_uppercase_char("A"));
assert!(pattern_has_uppercase_char("foo.EXE"));
assert!(!pattern_has_uppercase_char("a"));
assert!(!pattern_has_uppercase_char("foo.exe123"));
}
#[test]
fn pattern_has_uppercase_char_advanced() {
assert!(pattern_has_uppercase_char("foo.[a-zA-Z]"));
assert!(!pattern_has_uppercase_char(r"\Acargo"));
assert!(!pattern_has_uppercase_char(r"carg\x6F"));
}
#[test]
fn matches_strings_with_leading_dot_simple() {
assert!(pattern_matches_strings_with_leading_dot("^\\.gitignore"));
assert!(!pattern_matches_strings_with_leading_dot("^.gitignore"));
assert!(!pattern_matches_strings_with_leading_dot("\\.gitignore"));
assert!(!pattern_matches_strings_with_leading_dot("^gitignore"));
}
+168
View File
@@ -0,0 +1,168 @@
//! TTY-output sanitization to prevent terminal escape injection via filenames.
use std::borrow::Cow;
use std::fmt::Write;
/// True for any char that is neither printable nor permitted whitespace (only HT).
/// Covers C0/C1/DEL, bidi overrides, zero-width and format chars, and tag chars.
#[inline]
fn needs_escape(c: char) -> bool {
if c == '\t' {
return false;
}
c.is_control()
|| matches!(c,
'\u{00AD}' // soft hyphen (invisible)
| '\u{180E}' // Mongolian vowel separator
| '\u{200B}'..='\u{200F}' // zero-width + LRM/RLM
| '\u{202A}'..='\u{202E}' // bidi embedding/override
| '\u{2060}'..='\u{206F}' // word joiner, invisibles, deprecated formats
| '\u{FEFF}' // BOM / zero-width no-break space
| '\u{FFF9}'..='\u{FFFB}' // interlinear annotation
| '\u{E0000}'..='\u{E007F}' // language tags
)
}
/// Returns a `Cow<str>` borrowing `s` when no escaping is needed, otherwise an owned
/// escaped copy. Use this when an owned `&str`/`String` is required (e.g. ANSI paint).
pub fn sanitize_for_terminal(s: &str) -> Cow<'_, str> {
if !s.chars().any(needs_escape) {
return Cow::Borrowed(s);
}
let mut out = String::with_capacity(s.len());
for c in s.chars() {
if needs_escape(c) {
let v = c as u32;
if v <= 0xFF {
let _ = write!(out, "\\x{v:02X}");
} else {
let _ = write!(out, "\\u{{{v:04X}}}");
}
} else {
out.push(c);
}
}
Cow::Owned(out)
}
/// Sanitize for terminal output only; raw bytes pass through on pipes/files.
pub fn maybe_sanitize<'a>(s: &'a str, is_terminal: bool) -> Cow<'a, str> {
if is_terminal {
sanitize_for_terminal(s)
} else {
Cow::Borrowed(s)
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn preserves_safe_content() {
for s in [
"hello.txt",
"résumé.pdf",
"文档.txt",
"🦀.rs",
"a\tb",
"a\u{FFFD}b",
] {
assert!(
matches!(sanitize_for_terminal(s), Cow::Borrowed(_)),
"{s:?}"
);
assert_eq!(sanitize_for_terminal(s), s);
}
}
#[test]
fn strips_osc52_clipboard_payload() {
let attack = "innocent\x1b]52;c;cHduZWQ=\x1b\\.txt";
let safe = sanitize_for_terminal(attack);
assert!(!safe.contains('\x1b'));
assert_eq!(safe, "innocent\\x1B]52;c;cHduZWQ=\\x1B\\.txt");
}
#[test]
fn strips_cr_output_forgery() {
assert_eq!(sanitize_for_terminal("A\rFAKE OUTPUT"), "A\\x0DFAKE OUTPUT");
}
#[test]
fn strips_osc8_hyperlink_injection() {
let attack = "phish\x1b]8;;https:evil.example\x1b\\phony.txt";
assert!(!sanitize_for_terminal(attack).contains('\x1b'));
}
#[test]
fn strips_del() {
assert_eq!(sanitize_for_terminal("a\x7fb"), "a\\x7Fb");
}
#[test]
fn strips_bel_and_null() {
assert_eq!(sanitize_for_terminal("a\x07b"), "a\\x07b");
assert_eq!(sanitize_for_terminal("a\0b"), "a\\x00b");
}
#[test]
fn strips_newline() {
assert_eq!(sanitize_for_terminal("a\nb"), "a\\x0Ab");
}
#[test]
fn escape_preserves_information() {
let s = "name\x1bX\x07Y.txt";
assert_eq!(sanitize_for_terminal(s), "name\\x1BX\\x07Y.txt");
}
#[test]
fn strips_c1_csi_and_osc_initiators() {
// U+009B is CSI, U+009D is OSC; dangerous on 8-bit-control terminals.
assert_eq!(sanitize_for_terminal("\u{9b}31m"), "\\x9B31m");
assert_eq!(
sanitize_for_terminal("\u{9d}0;pwned\u{9c}"),
"\\x9D0;pwned\\x9C"
);
}
#[test]
fn strips_bidi_overrides_and_zero_width() {
// Trojan-Source style RLO/LRO that flip rendered order of filename text.
assert_eq!(
sanitize_for_terminal("safe\u{202E}fil\u{202D}gnp.exe"),
"safe\\u{202E}fil\\u{202D}gnp.exe"
);
// Zero-width space and BOM are also format chars used to disguise filenames.
assert_eq!(sanitize_for_terminal("a\u{200B}b"), "a\\u{200B}b");
assert_eq!(sanitize_for_terminal("\u{FEFF}name"), "\\u{FEFF}name");
}
#[test]
fn keeps_legitimate_unicode_features() {
// Variation selectors (U+FE0F, U+E0100..) modify preceding glyphs in CJK/emoji
// and are legitimate in filenames. Private-use chars are used by icon fonts.
for s in [
"heart\u{2764}\u{FE0F}.txt",
"icon\u{E000}.cfg",
"cjk\u{6F22}\u{E0101}.txt",
] {
assert!(
matches!(sanitize_for_terminal(s), Cow::Borrowed(_)),
"{s:?}"
);
}
}
#[test]
fn maybe_sanitize_passthrough_when_not_terminal() {
let attack = "x\x1by";
// Pipe context: bytes pass through unchanged (zero-copy).
let out = maybe_sanitize(attack, false);
assert!(matches!(out, Cow::Borrowed(_)));
assert_eq!(out, attack);
// TTY context: escapes apply.
assert_eq!(maybe_sanitize(attack, true), "x\\x1By");
}
}
+744
View File
@@ -0,0 +1,744 @@
use std::borrow::Cow;
use std::ffi::OsStr;
use std::io::{self, Write};
use std::mem;
use std::path::PathBuf;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex, MutexGuard};
use std::thread;
use std::time::{Duration, Instant};
use anyhow::{Result, anyhow};
use crossbeam_channel::{Receiver, RecvTimeoutError, SendError, Sender, bounded};
use etcetera::BaseStrategy;
use ignore::overrides::{Override, OverrideBuilder};
use ignore::{WalkBuilder, WalkParallel, WalkState};
use regex::bytes::Regex;
use crate::config::Config;
use crate::dir_entry::DirEntry;
use crate::error::print_error;
use crate::exec;
use crate::exit_codes::{ExitCode, merge_exitcodes};
use crate::filesystem;
use crate::output;
/// The receiver thread can either be buffering results or directly streaming to the console.
#[derive(PartialEq)]
enum ReceiverMode {
/// Receiver is still buffering in order to sort the results, if the search finishes fast
/// enough.
Buffering,
/// Receiver is directly printing results to the output.
Streaming,
}
/// The Worker threads can result in a valid entry having PathBuf or an error.
#[allow(clippy::large_enum_variant)]
#[derive(Debug)]
pub enum WorkerResult {
// Errors should be rare, so it's probably better to allow large_enum_variant than
// to box the Entry variant
Entry(DirEntry),
Error(ignore::Error),
}
/// A batch of WorkerResults to send over a channel.
#[derive(Clone)]
struct Batch {
items: Arc<Mutex<Option<Vec<WorkerResult>>>>,
}
impl Batch {
fn new() -> Self {
Self {
items: Arc::new(Mutex::new(Some(vec![]))),
}
}
fn lock(&self) -> MutexGuard<'_, Option<Vec<WorkerResult>>> {
self.items.lock().unwrap()
}
}
impl IntoIterator for Batch {
type Item = WorkerResult;
type IntoIter = std::vec::IntoIter<WorkerResult>;
fn into_iter(self) -> Self::IntoIter {
self.lock().take().unwrap().into_iter()
}
}
/// Wrapper that sends batches of items at once over a channel.
struct BatchSender {
batch: Batch,
tx: Sender<Batch>,
limit: usize,
}
impl BatchSender {
fn new(tx: Sender<Batch>, limit: usize) -> Self {
Self {
batch: Batch::new(),
tx,
limit,
}
}
/// Check if we need to flush a batch.
fn needs_flush(&self, batch: Option<&Vec<WorkerResult>>) -> bool {
match batch {
// Limit the batch size to provide some backpressure
Some(vec) => vec.len() >= self.limit,
// Batch was already taken by the receiver, so make a new one
None => true,
}
}
/// Add an item to a batch.
fn send(&mut self, item: WorkerResult) -> Result<(), SendError<()>> {
let mut batch = self.batch.lock();
if self.needs_flush(batch.as_ref()) {
drop(batch);
self.batch = Batch::new();
batch = self.batch.lock();
}
let items = batch.as_mut().unwrap();
items.push(item);
if items.len() == 1 {
// New batch, send it over the channel
self.tx
.send(self.batch.clone())
.map_err(|_| SendError(()))?;
}
Ok(())
}
}
/// Maximum size of the output buffer before flushing results to the console
const MAX_BUFFER_LENGTH: usize = 1000;
/// Default duration until output buffering switches to streaming.
const DEFAULT_MAX_BUFFER_TIME: Duration = Duration::from_millis(100);
/// Wrapper for the receiver thread's buffering behavior.
struct ReceiverBuffer<'a, W> {
/// The configuration.
config: &'a Config,
/// For shutting down the senders.
quit_flag: &'a AtomicBool,
/// The ^C notifier.
interrupt_flag: &'a AtomicBool,
/// Receiver for worker results.
rx: Receiver<Batch>,
/// Standard output.
stdout: W,
/// The current buffer mode.
mode: ReceiverMode,
/// The deadline to switch to streaming mode.
deadline: Instant,
/// The buffer of quickly received paths.
buffer: Vec<DirEntry>,
/// Result count.
num_results: usize,
}
impl<'a, W: Write> ReceiverBuffer<'a, W> {
/// Create a new receiver buffer.
fn new(state: &'a WorkerState, rx: Receiver<Batch>, stdout: W) -> Self {
let config = &state.config;
let quit_flag = state.quit_flag.as_ref();
let interrupt_flag = state.interrupt_flag.as_ref();
let max_buffer_time = config.max_buffer_time.unwrap_or(DEFAULT_MAX_BUFFER_TIME);
let deadline = Instant::now() + max_buffer_time;
Self {
config,
quit_flag,
interrupt_flag,
rx,
stdout,
mode: ReceiverMode::Buffering,
deadline,
buffer: Vec::with_capacity(MAX_BUFFER_LENGTH),
num_results: 0,
}
}
/// Process results until finished.
fn process(&mut self) -> ExitCode {
loop {
if let Err(ec) = self.poll() {
self.quit_flag.store(true, Ordering::Relaxed);
return ec;
}
}
}
/// Receive the next worker result.
fn recv(&self) -> Result<Batch, RecvTimeoutError> {
match self.mode {
ReceiverMode::Buffering => {
// Wait at most until we should switch to streaming
self.rx.recv_deadline(self.deadline)
}
ReceiverMode::Streaming => {
// Wait however long it takes for a result
Ok(self.rx.recv()?)
}
}
}
/// Wait for a result or state change.
fn poll(&mut self) -> Result<(), ExitCode> {
match self.recv() {
Ok(batch) => {
for result in batch {
match result {
WorkerResult::Entry(dir_entry) => {
if self.config.quiet {
return Err(ExitCode::HasResults(true));
}
match self.mode {
ReceiverMode::Buffering => {
self.buffer.push(dir_entry);
if self.buffer.len() > MAX_BUFFER_LENGTH {
self.stream()?;
}
}
ReceiverMode::Streaming => {
self.print(&dir_entry)?;
}
}
self.num_results += 1;
if let Some(max_results) = self.config.max_results
&& self.num_results >= max_results
{
return self.stop();
}
}
WorkerResult::Error(err) => {
if self.config.show_filesystem_errors {
print_error(err.to_string());
}
}
}
}
// If we don't have another batch ready, flush before waiting
if self.mode == ReceiverMode::Streaming && self.rx.is_empty() {
self.flush()?;
}
}
Err(RecvTimeoutError::Timeout) => {
self.stream()?;
}
Err(RecvTimeoutError::Disconnected) => {
return self.stop();
}
}
Ok(())
}
/// Output a path.
fn print(&mut self, entry: &DirEntry) -> Result<(), ExitCode> {
if let Err(e) = output::print_entry(&mut self.stdout, entry, self.config)
&& e.kind() != ::std::io::ErrorKind::BrokenPipe
{
print_error(format!("Could not write to output: {e}"));
return Err(ExitCode::GeneralError);
}
if self.interrupt_flag.load(Ordering::Relaxed) {
// Ignore any errors on flush, because we're about to exit anyway
let _ = self.flush();
return Err(ExitCode::KilledBySigint);
}
Ok(())
}
/// Switch ourselves into streaming mode.
fn stream(&mut self) -> Result<(), ExitCode> {
self.mode = ReceiverMode::Streaming;
let buffer = mem::take(&mut self.buffer);
for path in buffer {
self.print(&path)?;
}
self.flush()
}
/// Stop looping.
fn stop(&mut self) -> Result<(), ExitCode> {
if self.mode == ReceiverMode::Buffering {
self.buffer.sort();
self.stream()?;
}
if self.config.quiet {
Err(ExitCode::HasResults(self.num_results > 0))
} else {
Err(ExitCode::Success)
}
}
/// Flush stdout if necessary.
fn flush(&mut self) -> Result<(), ExitCode> {
if self.stdout.flush().is_err() {
// Probably a broken pipe. Exit gracefully.
return Err(ExitCode::GeneralError);
}
Ok(())
}
}
/// State shared by the sender and receiver threads.
struct WorkerState {
/// The search patterns.
patterns: Vec<Regex>,
/// The command line configuration.
config: Config,
/// Flag for cleanly shutting down the parallel walk
quit_flag: Arc<AtomicBool>,
/// Flag specifically for quitting due to ^C
interrupt_flag: Arc<AtomicBool>,
}
impl WorkerState {
fn new(patterns: Vec<Regex>, config: Config) -> Self {
let quit_flag = Arc::new(AtomicBool::new(false));
let interrupt_flag = Arc::new(AtomicBool::new(false));
Self {
patterns,
config,
quit_flag,
interrupt_flag,
}
}
fn build_overrides(&self, paths: &[PathBuf]) -> Result<Override> {
let first_path = &paths[0];
let config = &self.config;
let mut builder = OverrideBuilder::new(first_path);
for pattern in &config.exclude_patterns {
builder
.add(pattern)
.map_err(|e| anyhow!("Malformed exclude pattern: {}", e))?;
}
builder
.build()
.map_err(|_| anyhow!("Mismatch in exclude patterns"))
}
fn build_walker(&self, paths: &[PathBuf]) -> Result<WalkParallel> {
let first_path = &paths[0];
let config = &self.config;
let overrides = self.build_overrides(paths)?;
let mut builder = WalkBuilder::new(first_path);
builder
.hidden(config.ignore_hidden)
.ignore(config.read_fdignore)
.parents(config.read_parent_ignore && (config.read_fdignore || config.read_vcsignore))
.git_ignore(config.read_vcsignore)
.git_global(config.read_vcsignore)
.git_exclude(config.read_vcsignore)
.require_git(config.require_git_to_read_vcsignore)
.overrides(overrides)
.follow_links(config.follow_links)
// No need to check for supported platforms, option is unavailable on unsupported ones
.same_file_system(config.one_file_system)
.max_depth(config.max_depth);
if config.read_fdignore {
builder.add_custom_ignore_filename(".fdignore");
}
if config.read_global_ignore
&& let Ok(basedirs) = etcetera::choose_base_strategy()
{
let global_ignore_file = basedirs.config_dir().join("fd").join("ignore");
if global_ignore_file.is_file() {
let result = builder.add_ignore(global_ignore_file);
match result {
Some(ignore::Error::Partial(_)) => (),
Some(err) => {
print_error(format!("Malformed pattern in global ignore file. {err}."));
}
None => (),
}
}
}
for ignore_file in &config.ignore_files {
let result = builder.add_ignore(ignore_file);
match result {
Some(ignore::Error::Partial(_)) => (),
Some(err) => {
print_error(format!("Malformed pattern in custom ignore file. {err}."));
}
None => (),
}
}
for path in &paths[1..] {
builder.add(path);
}
let walker = builder.threads(config.threads).build_parallel();
Ok(walker)
}
/// Run the receiver work, either on this thread or a pool of background
/// threads (for --exec).
fn receive(&self, rx: Receiver<Batch>) -> ExitCode {
let config = &self.config;
// This will be set to `Some` if the `--exec` argument was supplied.
if let Some(ref cmd) = config.command {
if cmd.in_batch_mode() {
exec::batch(rx.into_iter().flatten(), cmd, config)
} else {
thread::scope(|scope| {
// Each spawned job will store its thread handle in here.
let threads = config.threads;
let mut handles = Vec::with_capacity(threads);
for _ in 0..threads {
let rx = rx.clone();
// Spawn a job thread that will listen for and execute inputs.
let handle =
scope.spawn(|| exec::job(rx.into_iter().flatten(), cmd, config));
// Push the handle of the spawned thread into the vector for later joining.
handles.push(handle);
}
let exit_codes = handles.into_iter().map(|handle| handle.join().unwrap());
merge_exitcodes(exit_codes)
})
}
} else {
let stdout = io::stdout().lock();
let stdout = io::BufWriter::new(stdout);
ReceiverBuffer::new(self, rx, stdout).process()
}
}
/// Spawn the sender threads.
fn spawn_senders(&self, walker: WalkParallel, tx: Sender<Batch>) {
walker.run(|| {
let patterns = &self.patterns;
let config = &self.config;
let quit_flag = self.quit_flag.as_ref();
let mut limit = 0x100;
if let Some(cmd) = &config.command
&& !cmd.in_batch_mode()
&& config.threads > 1
{
// Evenly distribute work between multiple receivers
limit = 1;
}
let mut tx = BatchSender::new(tx.clone(), limit);
Box::new(move |entry| {
if quit_flag.load(Ordering::Relaxed) {
return WalkState::Quit;
}
if let Ok(e) = &entry {
// If the entry is a directory that contains a
// "ignore contain" file", we want to skip this
// directory.
// Check the filetype first to avoid unnecessary
// syscalls.
if e.file_type().is_some_and(|t| t.is_dir()) {
let entry_path = e.path();
if config
.ignore_contain
.iter()
.any(|ic| entry_path.join(ic).exists())
{
return WalkState::Skip;
}
}
if e.depth() == 0 {
// Skip the root directory entry.
return WalkState::Continue;
}
}
let entry = match entry {
Ok(e) => DirEntry::normal(e),
Err(ignore::Error::WithPath {
path,
err: inner_err,
}) if inner_err
.io_error()
.is_some_and(|io_error| io_error.kind() == io::ErrorKind::NotFound)
&& path
.symlink_metadata()
.ok()
.is_some_and(|m| m.file_type().is_symlink()) =>
{
DirEntry::broken_symlink(path)
}
Err(err) => {
return match tx.send(WorkerResult::Error(err)) {
Ok(_) => WalkState::Continue,
Err(_) => WalkState::Quit,
};
}
};
if let Some(min_depth) = config.min_depth
&& entry.depth().is_none_or(|d| d < min_depth)
{
return WalkState::Continue;
}
// Check the name first, since it doesn't require metadata
let entry_path = entry.path();
let search_str = search_str_for_entry(entry_path, config.full_path_base.as_deref());
if !patterns
.iter()
.all(|pat| pat.is_match(&filesystem::osstr_to_bytes(search_str.as_ref())))
{
return WalkState::Continue;
}
// Filter out unwanted extensions.
if let Some(ref exts_regex) = config.extensions {
if let Some(path_str) = entry_path.file_name() {
if !exts_regex.is_match(&filesystem::osstr_to_bytes(path_str)) {
return WalkState::Continue;
}
} else {
return WalkState::Continue;
}
}
// Filter out unwanted file types.
if let Some(ref file_types) = config.file_types
&& file_types.should_ignore(&entry)
{
return WalkState::Continue;
}
#[cfg(unix)]
{
if let Some(ref owner_constraint) = config.owner_constraint {
if let Some(metadata) = entry.metadata() {
if !owner_constraint.matches(metadata) {
return WalkState::Continue;
}
} else {
return WalkState::Continue;
}
}
}
// Filter out unwanted sizes if it is a file and we have been given size constraints.
if !config.size_constraints.is_empty() {
if entry_path.is_file() {
if let Some(metadata) = entry.metadata() {
let file_size = metadata.len();
if config
.size_constraints
.iter()
.any(|sc| !sc.is_within(file_size))
{
return WalkState::Continue;
}
} else {
return WalkState::Continue;
}
} else {
return WalkState::Continue;
}
}
// Filter out unwanted modification times
if !config.time_constraints.is_empty() {
let mut matched = false;
if let Some(metadata) = entry.metadata()
&& let Ok(modified) = metadata.modified()
{
matched = config
.time_constraints
.iter()
.all(|tf| tf.applies_to(&modified));
}
if !matched {
return WalkState::Continue;
}
}
if config.is_printing()
&& let Some(ls_colors) = &config.ls_colors
{
// Compute colors in parallel
entry.style(ls_colors);
}
let send_result = tx.send(WorkerResult::Entry(entry));
if send_result.is_err() {
return WalkState::Quit;
}
// Apply pruning.
if config.prune {
return WalkState::Skip;
}
WalkState::Continue
})
});
}
/// Perform the recursive scan.
fn scan(&self, paths: &[PathBuf]) -> Result<ExitCode> {
let config = &self.config;
let walker = self.build_walker(paths)?;
if config.ls_colors.is_some() && config.is_printing() {
let quit_flag = Arc::clone(&self.quit_flag);
let interrupt_flag = Arc::clone(&self.interrupt_flag);
ctrlc::set_handler(move || {
quit_flag.store(true, Ordering::Relaxed);
if interrupt_flag.fetch_or(true, Ordering::Relaxed) {
// Ctrl-C has been pressed twice, exit NOW
ExitCode::KilledBySigint.exit();
}
})
.unwrap();
}
let (tx, rx) = bounded(2 * config.threads);
let exit_code = thread::scope(|scope| {
// Spawn the receiver thread(s)
let receiver = scope.spawn(|| self.receive(rx));
// Spawn the sender threads.
self.spawn_senders(walker, tx);
receiver.join().unwrap()
});
if self.interrupt_flag.load(Ordering::Relaxed) {
Ok(ExitCode::KilledBySigint)
} else {
Ok(exit_code)
}
}
}
fn search_str_for_entry<'a>(
entry_path: &'a std::path::Path,
full_path_base: Option<&std::path::Path>,
) -> Cow<'a, OsStr> {
if let Some(cwd) = full_path_base {
// If full_path_base is some, that means that we need to return
// the absolute path
if entry_path.is_absolute() {
return Cow::Borrowed(entry_path.as_os_str());
}
let path = entry_path.strip_prefix(".").unwrap_or(entry_path);
Cow::Owned(cwd.join(path).into())
} else {
match entry_path.file_name() {
Some(filename) => Cow::Borrowed(filename),
None => unreachable!(
"Encountered file system entry without a file name. This should only \
happen for paths like 'foo/bar/..' or '/' which are not supposed to \
appear in a file system traversal."
),
}
}
}
/// Recursively scan the given search path for files / pathnames matching the patterns.
///
/// If the `--exec` argument was supplied, this will create a thread pool for executing
/// jobs in parallel from a given command line and the discovered paths. Otherwise, each
/// path will simply be written to standard output.
pub fn scan(paths: &[PathBuf], patterns: Vec<Regex>, config: Config) -> Result<ExitCode> {
WorkerState::new(patterns, config).scan(paths)
}
#[cfg(test)]
mod tests {
use super::search_str_for_entry;
use std::path::{Path, PathBuf};
#[test]
fn search_str_for_entry_with_relative_path() {
let full_path_base = Some(Path::new("/home/user"));
assert_eq!(
search_str_for_entry(Path::new("foo/bar"), full_path_base),
PathBuf::from("/home/user/foo/bar")
);
}
#[test]
fn search_str_for_entry_strips_dot_prefix() {
let full_path_base = Some(Path::new("/home/user"));
assert_eq!(
search_str_for_entry(Path::new("./foo/bar"), full_path_base),
PathBuf::from("/home/user/foo/bar")
);
}
#[test]
fn search_str_for_entry_with_absolute_path() {
let full_path_base = Some(Path::new("/home/user"));
assert_eq!(
search_str_for_entry(Path::new("/absolute/path"), full_path_base),
PathBuf::from("/absolute/path")
);
}
#[test]
fn search_str_no_base_dir() {
assert_eq!(
search_str_for_entry(Path::new("./foo/bar"), None),
PathBuf::from("bar")
);
}
#[test]
fn search_str_no_base_dir_with_plain_relative_path() {
assert_eq!(
search_str_for_entry(Path::new("foo/bar"), None),
PathBuf::from("bar")
);
}
#[test]
fn search_str_no_base_dir_with_file_in_current_dir() {
assert_eq!(
search_str_for_entry(Path::new("foo"), None),
PathBuf::from("foo")
);
}
}
-242
View File
@@ -1,242 +0,0 @@
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
fd="${SCRIPT_DIR}/../target/debug/fd"
MKTEMP_TEMPLATE="fd-tests.XXXXXXXXXX"
# Stabilize sort
export LC_ALL="C"
export LC_CTYPE="UTF-8"
export reset='\x1b[0m'
export bold='\x1b[01m'
export green='\x1b[32;01m'
export red='\x1b[31;01m'
set -eou pipefail
suite() {
echo
echo -e "${bold}$1${reset}"
echo
}
expect() {
expected_output="$1"
shift
tmp_expected="$(mktemp -t "$MKTEMP_TEMPLATE")"
tmp_output="$(mktemp -t "$MKTEMP_TEMPLATE")"
echo "$expected_output" > "$tmp_expected"
# Use python instead of sed here (for this to work on macOS)
"$fd" "$@" | python -c 'import sys; sys.stdout.write(sys.stdin.read().replace("\0", "NULL\n"))' | sort -f > "$tmp_output"
echo -ne " ${bold}${reset} Testing 'fd $*' ... "
if diff -q "$tmp_expected" "$tmp_output" > /dev/null; then
echo -e "${green}✓ okay${reset}"
rm -f "$tmp_expected" "$tmp_output"
else
echo -e "${red}❌FAILED${reset}"
echo -ne "\nShowing diff between ${red}expected${reset} and "
echo -e "${green}actual${reset} output:\n"
diff -C3 --label expected --label actual \
"$tmp_expected" "$tmp_output" || true
rm -f "$tmp_expected" "$tmp_output"
exit 1
fi
}
root=$(mktemp -d -t "$MKTEMP_TEMPLATE")
cd "$root"
# Setup test environment
mkdir -p one/two/three
touch a.foo
touch one/b.foo
touch one/two/c.foo
touch one/two/C.Foo2
touch one/two/three/d.foo
mkdir one/two/three/directory_foo
touch ignored.foo
touch .hidden.foo
ln -s one/two symlink
echo "ignored.foo" > .ignore
# Run the tests
suite "Simple tests"
expect "a.foo" a.foo
expect "one/b.foo" b.foo
expect "one/two/three/d.foo" d.foo
expect "a.foo
one/b.foo
one/two/c.foo
one/two/C.Foo2
one/two/three/d.foo
one/two/three/directory_foo" foo
expect "a.foo
one
one/b.foo
one/two
one/two/c.foo
one/two/C.Foo2
one/two/three
one/two/three/d.foo
one/two/three/directory_foo
symlink" # run 'fd' without arguments
suite "Explicit root path"
expect "one/b.foo
one/two/c.foo
one/two/C.Foo2
one/two/three/d.foo
one/two/three/directory_foo" foo one
expect "one/two/three/d.foo
one/two/three/directory_foo" foo one/two/three
(
cd one/two
expect "../../a.foo
../b.foo
c.foo
C.Foo2
three/d.foo
three/directory_foo" foo ../../
)
suite "Regex searches"
expect "a.foo
one/b.foo
one/two/c.foo
one/two/C.Foo2" '[a-c].foo'
expect "a.foo
one/b.foo
one/two/c.foo" --case-sensitive '[a-c].foo'
suite "Smart case"
expect "one/two/c.foo
one/two/C.Foo2" c.foo
expect "one/two/C.Foo2" C.Foo
expect "one/two/C.Foo2" Foo
suite "Case-sensitivity (--case-sensitive)"
expect "one/two/c.foo" --case-sensitive c.foo
expect "one/two/C.Foo2" --case-sensitive C.Foo
suite "Full path search (--full-path)"
expect "one/two/three/d.foo
one/two/three/directory_foo" --full-path 'three.*foo'
expect "a.foo" --full-path '^a\.foo$'
suite "Hidden files (--hidden)"
expect ".hidden.foo
a.foo
one/b.foo
one/two/c.foo
one/two/C.Foo2
one/two/three/d.foo
one/two/three/directory_foo" --hidden foo
suite "Ignored files (--no-ignore)"
expect "a.foo
ignored.foo
one/b.foo
one/two/c.foo
one/two/C.Foo2
one/two/three/d.foo
one/two/three/directory_foo" --no-ignore foo
expect ".hidden.foo
a.foo
ignored.foo
one/b.foo
one/two/c.foo
one/two/C.Foo2
one/two/three/d.foo
one/two/three/directory_foo" --hidden --no-ignore foo
suite "Symlinks (--follow)"
expect "one/two/c.foo
one/two/C.Foo2
symlink/c.foo
symlink/C.Foo2" --follow c.foo
suite "Null separator (--print0)"
expect "a.fooNULL
one/b.fooNULL
one/two/C.Foo2NULL
one/two/c.fooNULL
one/two/three/d.fooNULL
one/two/three/directory_fooNULL" --print0 foo
suite "Maximum depth (--max-depth)"
expect "a.foo
one
one/b.foo
one/two
one/two/c.foo
one/two/C.Foo2
one/two/three
symlink" --max-depth 3
expect "a.foo
one
one/b.foo
one/two
symlink" --max-depth 2
expect "a.foo
one
symlink" --max-depth 1
abs_path=$(python -c "import os; print(os.path.realpath('$root'))")
suite "Absolute paths (--absolute-path)"
expect "$abs_path/a.foo
$abs_path/one/b.foo
$abs_path/one/two/c.foo
$abs_path/one/two/C.Foo2
$abs_path/one/two/three/d.foo
$abs_path/one/two/three/directory_foo" --absolute-path foo
expect "$abs_path/a.foo
$abs_path/one/b.foo
$abs_path/one/two/c.foo
$abs_path/one/two/C.Foo2
$abs_path/one/two/three/d.foo
$abs_path/one/two/three/directory_foo" foo "$abs_path"
suite "File type filter (--type)"
expect "a.foo
one/b.foo
one/two/c.foo
one/two/C.Foo2
one/two/three/d.foo" --type f
expect "one
one/two
one/two/three
one/two/three/directory_foo" --type d
expect "symlink" --type s
# All done
echo
+344
View File
@@ -0,0 +1,344 @@
use std::env;
use std::fs;
use std::io::{self, Write};
#[cfg(unix)]
use std::os::unix;
#[cfg(windows)]
use std::os::windows;
use std::path::{Path, PathBuf};
use std::process;
use tempfile::TempDir;
/// Environment for the integration tests.
pub struct TestEnv {
/// Temporary working directory.
temp_dir: TempDir,
/// Path to the *fd* executable.
fd_exe: PathBuf,
/// Normalize each line by sorting the whitespace-separated words
normalize_line: bool,
/// Temporary directory for storing test config (global ignore file)
config_dir: Option<TempDir>,
}
/// Create the working directory and the test files.
fn create_working_directory(
directories: &[&'static str],
files: &[&'static str],
) -> Result<TempDir, io::Error> {
let temp_dir = tempfile::Builder::new().prefix("fd-tests").tempdir()?;
{
let root = temp_dir.path();
// Pretend that this is a Git repository in order for `.gitignore` files to be respected
fs::create_dir_all(root.join(".git"))?;
for directory in directories {
fs::create_dir_all(root.join(directory))?;
}
for file in files {
fs::File::create(root.join(file))?;
}
#[cfg(unix)]
unix::fs::symlink(root.join("one/two"), root.join("symlink"))?;
// Note: creating symlinks on Windows requires the `SeCreateSymbolicLinkPrivilege` which
// is by default only granted for administrators.
#[cfg(windows)]
windows::fs::symlink_dir(root.join("one/two"), root.join("symlink"))?;
fs::File::create(root.join(".fdignore"))?.write_all(b"fdignored.foo")?;
fs::File::create(root.join(".gitignore"))?.write_all(b"gitignored.foo")?;
}
Ok(temp_dir)
}
fn create_config_directory_with_global_ignore(ignore_file_content: &str) -> io::Result<TempDir> {
let config_dir = tempfile::Builder::new().prefix("fd-config").tempdir()?;
let fd_dir = config_dir.path().join("fd");
fs::create_dir(&fd_dir)?;
let mut ignore_file = fs::File::create(fd_dir.join("ignore"))?;
ignore_file.write_all(ignore_file_content.as_bytes())?;
Ok(config_dir)
}
/// Find the *fd* executable.
fn find_fd_exe() -> PathBuf {
// Read the location of the fd executable from the environment
PathBuf::from(env::var("CARGO_BIN_EXE_fd").unwrap_or(env!("CARGO_BIN_EXE_fd").to_string()))
}
/// Format an error message for when *fd* did not exit successfully.
fn format_exit_error(args: &[&str], output: &process::Output) -> String {
format!(
"`fd {}` did not exit successfully.\nstdout:\n---\n{}---\nstderr:\n---\n{}---",
args.join(" "),
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr)
)
}
/// Format an error message for when the output of *fd* did not match the expected output.
fn format_output_error(args: &[&str], expected: &str, actual: &str) -> String {
// Generate diff text.
let diff_text = diff::lines(expected, actual)
.into_iter()
.map(|diff| match diff {
diff::Result::Left(l) => format!("-{l}"),
diff::Result::Both(l, _) => format!(" {l}"),
diff::Result::Right(r) => format!("+{r}"),
})
.collect::<Vec<_>>()
.join("\n");
format!(
concat!(
"`fd {}` did not produce the expected output.\n",
"Showing diff between expected and actual:\n{}\n"
),
args.join(" "),
diff_text
)
}
/// Normalize the output for comparison.
fn normalize_output(s: &str, trim_start: bool, normalize_line: bool) -> String {
// Split into lines and normalize separators.
let mut lines = s
.replace('\0', "NULL\n")
.lines()
.map(|line| {
let line = if trim_start { line.trim_start() } else { line };
let line = line.replace('/', std::path::MAIN_SEPARATOR_STR);
if normalize_line {
let mut words: Vec<_> = line.split_whitespace().collect();
words.sort_unstable();
return words.join(" ");
}
line
})
.collect::<Vec<_>>();
lines.sort();
lines.join("\n")
}
/// Trim whitespace from the beginning of each line.
fn trim_lines(s: &str) -> String {
s.lines()
.map(|line| line.trim_start())
.fold(String::new(), |mut str, line| {
str.push_str(line);
str.push('\n');
str
})
}
impl TestEnv {
pub fn new(directories: &[&'static str], files: &[&'static str]) -> TestEnv {
let temp_dir = create_working_directory(directories, files).expect("working directory");
let fd_exe = find_fd_exe();
TestEnv {
temp_dir,
fd_exe,
normalize_line: false,
config_dir: None,
}
}
pub fn normalize_line(self, normalize: bool) -> TestEnv {
TestEnv {
temp_dir: self.temp_dir,
fd_exe: self.fd_exe,
normalize_line: normalize,
config_dir: self.config_dir,
}
}
pub fn global_ignore_file(self, content: &str) -> TestEnv {
let config_dir =
create_config_directory_with_global_ignore(content).expect("config directory");
TestEnv {
config_dir: Some(config_dir),
..self
}
}
/// Create a broken symlink at the given path in the temp_dir.
pub fn create_broken_symlink<P: AsRef<Path>>(
&mut self,
link_path: P,
) -> Result<PathBuf, io::Error> {
let root = self.test_root();
let broken_symlink_link = root.join(link_path);
{
let temp_target_dir = tempfile::Builder::new()
.prefix("fd-tests-broken-symlink")
.tempdir()?;
let broken_symlink_target = temp_target_dir.path().join("broken_symlink_target");
fs::File::create(&broken_symlink_target)?;
#[cfg(unix)]
unix::fs::symlink(&broken_symlink_target, &broken_symlink_link)?;
#[cfg(windows)]
windows::fs::symlink_file(&broken_symlink_target, &broken_symlink_link)?;
}
Ok(broken_symlink_link)
}
/// Get the root directory for the tests.
pub fn test_root(&self) -> PathBuf {
self.temp_dir.path().to_path_buf()
}
/// Get the path of the fd executable.
#[cfg_attr(windows, allow(unused))]
pub fn test_exe(&self) -> &PathBuf {
&self.fd_exe
}
/// Get the root directory of the file system.
pub fn system_root(&self) -> PathBuf {
let mut components = self.temp_dir.path().components();
PathBuf::from(components.next().expect("root directory").as_os_str())
}
/// Assert that calling *fd* in the specified path under the root working directory,
/// and with the specified arguments produces the expected output.
pub fn assert_success_and_get_output<P: AsRef<Path>>(
&self,
path: P,
args: &[&str],
) -> process::Output {
// Run *fd*.
let output = self.run_command(path.as_ref(), args);
// Check for exit status.
if !output.status.success() {
panic!("{}", format_exit_error(args, &output));
}
output
}
pub fn assert_success_and_get_normalized_output<P: AsRef<Path>>(
&self,
path: P,
args: &[&str],
) -> String {
let output = self.assert_success_and_get_output(path, args);
normalize_output(
&String::from_utf8_lossy(&output.stdout),
false,
self.normalize_line,
)
}
/// Assert that calling *fd* with the specified arguments produces the expected output.
pub fn assert_output(&self, args: &[&str], expected: &str) {
self.assert_output_subdirectory(".", args, expected)
}
/// Similar to assert_output, but able to handle non-utf8 output
#[cfg(all(unix, not(target_os = "macos")))]
pub fn assert_output_raw(&self, args: &[&str], expected: &[u8]) {
let output = self.assert_success_and_get_output(".", args);
assert_eq!(expected, &output.stdout[..]);
}
/// Assert that calling *fd* in the specified path under the root working directory,
/// and with the specified arguments produces the expected output.
pub fn assert_output_subdirectory<P: AsRef<Path>>(
&self,
path: P,
args: &[&str],
expected: &str,
) {
// Normalize both expected and actual output.
let expected = normalize_output(expected, true, self.normalize_line);
let actual = self.assert_success_and_get_normalized_output(path, args);
// Compare actual output to expected output.
if expected != actual {
panic!("{}", format_output_error(args, &expected, &actual));
}
}
/// Assert that calling *fd* with the specified arguments produces the expected error,
/// and does not succeed.
pub fn assert_failure_with_error(&self, args: &[&str], expected: &str) {
let status = self.assert_error_subdirectory(".", args, Some(expected));
if status.success() {
panic!("error '{expected}' did not occur.");
}
}
/// Assert that calling *fd* with the specified arguments does not succeed.
pub fn assert_failure(&self, args: &[&str]) {
let status = self.assert_error_subdirectory(".", args, None);
if status.success() {
panic!("Failure did not occur as expected.");
}
}
/// Assert that calling *fd* with the specified arguments produces the expected error.
pub fn assert_error(&self, args: &[&str], expected: &str) -> process::ExitStatus {
self.assert_error_subdirectory(".", args, Some(expected))
}
fn run_command(&self, path: &Path, args: &[&str]) -> process::Output {
// Setup *fd* command.
let mut cmd = process::Command::new(&self.fd_exe);
cmd.current_dir(self.temp_dir.path().join(path));
if let Some(config_dir) = &self.config_dir {
cmd.env("XDG_CONFIG_HOME", config_dir.path());
} else {
cmd.arg("--no-global-ignore-file");
}
// Make sure LS_COLORS is unset to ensure consistent
// color output
cmd.env("LS_COLORS", "");
cmd.args(args);
// Run *fd*.
cmd.output().expect("fd output")
}
/// Assert that calling *fd* in the specified path under the root working directory,
/// and with the specified arguments produces an error with the expected message.
fn assert_error_subdirectory<P: AsRef<Path>>(
&self,
path: P,
args: &[&str],
expected: Option<&str>,
) -> process::ExitStatus {
let output = self.run_command(path.as_ref(), args);
if let Some(expected) = expected {
// Normalize both expected and actual output.
let expected_error = trim_lines(expected);
let actual_err = trim_lines(&String::from_utf8_lossy(&output.stderr));
// Compare actual output to expected output.
if !actual_err.trim_start().starts_with(&expected_error) {
panic!(
"{}",
format_output_error(args, &expected_error, &actual_err)
);
}
}
output.status
}
}
+2878
View File
File diff suppressed because it is too large Load Diff