Commit graph

58 commits

Author SHA1 Message Date
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
9529f30129 fix: Respect NO_COLOR with --list-details option
Fixes: #1455
2023-12-23 21:32:33 +01:00
Tavian Barnes
fea1622724 cli: Tweak default thread count logic 2023-12-18 21:55:18 +01: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:🧵: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
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
08910e4e3f docs: Some tweaks from review 2023-10-23 08:34:03 +02:00
Thayne McCombs
53fd416c47 docs: Document exclusion of .git/ 2023-10-23 08:34:03 +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
Christian Göttsche
36bc84041b Support character and block device file types 2023-10-21 13:56:33 +02: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
Eden Mikitas
dea9110b90 Making -1 conflict with --exec and making max-results override -1 2023-10-05 15:10:37 +03: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
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
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
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](3bb71b0cb8/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 (ebf17eef22)
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
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
36e60223eb Use allow_hyphen_values = true for --and <pattern> 2022-11-21 21:08:41 +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
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
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
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
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
Dominik Hassler
6ebc366146 anyhow is not only used for the completions feature 2022-11-07 17:11:00 +00:00
David Peter
f15be89bff Fix --threads/-j option value parsing 2022-11-02 13:32:22 +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
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
3f72ef4cdd Remove outdated TODO comment 2022-11-01 20:07:09 +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
3782278f02 Improve help output 2022-10-20 00:34:52 -06:00
Thayne McCombs
aec125637b Fix format 2022-10-14 23:14:03 -06: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
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