docs(exec): clarify command ordering and output grouping for -x/--exec
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by pederbe · committed by Thayne McCombs · parent 0e01c8c · Browse files · 2 files·+12 added−8 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+12 added−8 removed
- other:+12 added−8 removed
Provenance
- Commit
468cd43- Tree
04e0b8e- Author
pederbe <peder.bergan@gmail.com>- Committer
Thayne McCombs <astrothayne@gmail.com>- Parent
0e01c8c
2 files changed+12 added−8 removed
modified:doc/fd.1+6 added-6 removed
446 unmodified lines447 - not to fd.448 It is therefore recommended to place the \-x/\-\-exec option last. Alternatively, you can supply449 a ';' argument to end the argument list and continue with more fd options.450 Most shells require ';' to be escaped: '\\;'.451-This option can be specified multiple times, in which case all commands are run for each452-file found, in the order they are provided. In that case, you must supply a ';' argument for453-all but the last commands.451+This option can be specified multiple times. Commands for the same search result run sequentially452+in the order they are given. In that case, you must supply a ';' argument for all but the last command.453+When running in parallel, fd buffers command output and prints it together for each search result,454+without interleaving it with command output for other results.455 455-If parallelism is enabled, the order commands will be executed in is non-deterministic. And even with456---threads=1, the order is determined by the operating system and may not be what you expect. Thus, it is457-recommended that you don't rely on any ordering of the results.456+The order in which different search results are processed and their output is printed is not457+guaranteed, even with --threads=1.458 459 Before executing the command, any placeholder patterns in the command are replaced with the460 corresponding values for the current file. The same placeholders are used as in the "\-\-format"461 option.126 unmodified linesmodified:src/cli.rs+6 added-2 removed
893 unmodified lines894 .conflicts_with("list_details")895 .help("Execute a command for each search result")896 .long_help(897 "Execute a command for each search result in parallel (use --threads=1 for sequential command execution). \898- There is no guarantee of the order commands are executed in, and the order should not be depended upon. \898+ The order in which different search results are processed and their output is printed is not guaranteed, even with --threads=1. \899 All positional arguments following --exec are considered to be arguments to the command - not to fd. \900 It is therefore recommended to place the '-x'/'--exec' option last. \901- Use '\\;' to terminate the command template if you need to continue passing fd arguments afterwards.\n\901+ Use '\\;' to terminate the command template if you need to continue passing fd arguments afterwards.\n\n\902+ This option can be specified multiple times. Commands for the same search result run sequentially in the order they are given. \903+ Terminate each command except the last with '\\;'. \904+ When running in parallel, fd buffers command output and prints it together for each search result, \905+ without interleaving it with command output for other results.\n\n\906 The following placeholders are substituted before the command is executed:\n \907 '{}': path (of the current search result)\n \908 '{/}': basename\n \909 '{//}': parent directory\n \68 unmodified lines