Commit Graph

112 Commits

Author SHA1 Message Date
Thayne McCombs d44badc190 Implement option for printing custom formats 2024-05-07 22:52:49 -06:00
binlingyu 7794c4aae5 Use 'MAIN_SEPARATOR_STR' instead of '&MAIN_SEPARATOR.to_string()' 2024-04-15 10:36:10 +08:00
garlic-hub 0788c43c3f
Clean up clippy warnings 2024-03-08 10:46:24 -08:00
Tavian Barnes 73260c0e35 walk: Send WorkerResults in batches 2023-11-28 15:51:33 -05:00
João Marcos P. Bezerra 7263b5e01d Fix docs typos 2023-10-24 00:40:12 -03: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 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 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
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 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
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 169d22fde2 Merge remote-tracking branch 'origin/master' into clap-derive 2022-11-01 20:00:16 +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
amesgen cb95f1dcd5
Respect exit codes with `--exec-batch` 2022-10-13 23:33:54 +02:00
Thayne McCombs c41d61eeda Merge remote-tracking branch 'upstream/master' into clap-derive 2022-10-09 01:00:48 -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 4ffc34956f Make --strip-cwd-prefix apply to -x/-X
Fixes #898.
2022-10-03 21:35:39 +02:00
David Peter 9ea882d7cc Fix clippy suggestions 2022-09-11 21:29:43 +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 c7370ca82c Simplistic "Command not found" error message 2022-09-11 20:58:50 +02:00
Tavian Barnes 40b368e761 exec: Execute batches before they get too long
Fixes #410.
2022-05-28 22:19:47 +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 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 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 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
Thayne McCombs 6e5c8d9c20 Fix some clippy warnings 2022-03-04 08:30:41 +01: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
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 813a802b2c send DirEntries to output instead of just path 2021-12-11 15:42:07 +02: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
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 92bd7850d0 Merge remote-tracking branch 'origin/master' into no-strip/760 2021-11-26 18:19:28 +01:00
David Peter 47421a49b8 Remove strip-prefix placeholders 2021-11-26 17:58:18 +01:00
Shun Sakai 0484486f3f Remove `lazy_static` from dependencies 2021-11-25 20:06:43 +01: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 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
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
a1346054 5b4869a940 fix spelling 2021-08-14 16:21:02 +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