Skip to content
Myr

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

2 files+12 added−8 removed

modified:doc/fd.1+6 added-6 removed
446 unmodified lines
447- not to fd.448It is therefore recommended to place the \-x/\-\-exec option last. Alternatively, you can supply449a ';' argument to end the argument list and continue with more fd options.450Most shells require ';' to be escaped: '\\;'.451This option can be specified multiple times, in which case all commands are run for each452file found, in the order they are provided. In that case, you must supply a ';' argument for453all but the last commands.451This option can be specified multiple times. Commands for the same search result run sequentially452in the order they are given. In that case, you must supply a ';' argument for all but the last command.453When running in parallel, fd buffers command output and prints it together for each search result,454without interleaving it with command output for other results.455455If 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 is457recommended that you don't rely on any ordering of the results.456The order in which different search results are processed and their output is printed is not457guaranteed, even with --threads=1.458459Before executing the command, any placeholder patterns in the command are replaced with the460corresponding values for the current file. The same placeholders are used as in the "\-\-format"461option.
126 unmodified lines
modified:src/cli.rs+6 added-2 removed
893 unmodified lines
894 .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