Commit Graph

80 Commits

Author SHA1 Message Date
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
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
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
David Peter 2a2126c40a Fix clippy warnings 2021-07-27 09:05:23 +02: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
Alexandru Macovei 4f4330167a Fix some clippy lints, and format 2020-05-01 14:08:53 +02:00
sharkdp 95eae00126 Fix test on Windows 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 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 e42ddda5a6 Clean up exit code handling 2020-04-03 10:48:27 +02:00
sharkdp 4274075f6f Remove outdated license headers (not strictly required by Apache-2.0) 2020-04-03 10:19:13 +02: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 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
MarcoIeni 320d7fca0a Sort search results when using -X option 2020-01-02 21:52:26 +01:00
sharkdp a0505bd4df Expose exit status from `--exec-batch <cmd>`
closes #333
2019-09-13 23:05:35 +02:00
Alexandru Macovei d8bd5f9d51 macronize repetitive tests in exec/input 2019-01-26 16:15:48 +01:00
Alexandru Macovei 051ff5987a [2018 edition] remove all extern crate lines from sources 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
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
sharkdp 81a27fa9bd Unify error messages, closes #342 2018-10-27 16:30:29 +02:00
Park Juhyung 095bad550f Print errors when --verbose is set 2018-10-23 21:50:25 +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