mirror of
https://github.com/sharkdp/fd
synced 2024-07-05 09:19:11 +00:00
docs: Explicitly warn against relying on result order for exec
Supersedes: #1230 Fixes: #1228
This commit is contained in:
parent
306dacd0b4
commit
c6fcdbe000
7
doc/fd.1
vendored
7
doc/fd.1
vendored
|
@ -379,6 +379,10 @@ This option can be specified multiple times, in which case all commands are run
|
||||||
file found, in the order they are provided. In that case, you must supply a ';' argument for
|
file found, in the order they are provided. In that case, you must supply a ';' argument for
|
||||||
all but the last commands.
|
all but the last commands.
|
||||||
|
|
||||||
|
If parallelism is enabled, the order commands will be exectued in is non-deterministic. And even with
|
||||||
|
--threads=1, the order is determined by the operating system and may not be what you expect. Thus, it is
|
||||||
|
recommended that you don't rely on any ordering of the results.
|
||||||
|
|
||||||
The following placeholders are substituted before the command is executed:
|
The following placeholders are substituted before the command is executed:
|
||||||
.RS
|
.RS
|
||||||
.IP {}
|
.IP {}
|
||||||
|
@ -422,6 +426,9 @@ Examples:
|
||||||
Execute
|
Execute
|
||||||
.I command
|
.I command
|
||||||
once, with all search results as arguments.
|
once, with all search results as arguments.
|
||||||
|
|
||||||
|
The order of the arguments is non-deterministic and should not be relied upon.
|
||||||
|
|
||||||
One of the following placeholders is substituted before the command is executed:
|
One of the following placeholders is substituted before the command is executed:
|
||||||
.RS
|
.RS
|
||||||
.IP {}
|
.IP {}
|
||||||
|
|
|
@ -804,6 +804,7 @@ impl clap::Args for Exec {
|
||||||
.help("Execute a command for each search result")
|
.help("Execute a command for each search result")
|
||||||
.long_help(
|
.long_help(
|
||||||
"Execute a command for each search result in parallel (use --threads=1 for sequential command execution). \
|
"Execute a command for each search result in parallel (use --threads=1 for sequential command execution). \
|
||||||
|
There is no guarantee of the order commands are executed in, and the order should not be depended upon. \
|
||||||
All positional arguments following --exec are considered to be arguments to the command - not to fd. \
|
All positional arguments following --exec are considered to be arguments to the command - not to fd. \
|
||||||
It is therefore recommended to place the '-x'/'--exec' option last.\n\
|
It is therefore recommended to place the '-x'/'--exec' option last.\n\
|
||||||
The following placeholders are substituted before the command is executed:\n \
|
The following placeholders are substituted before the command is executed:\n \
|
||||||
|
@ -838,6 +839,7 @@ impl clap::Args for Exec {
|
||||||
.help("Execute a command with all search results at once")
|
.help("Execute a command with all search results at once")
|
||||||
.long_help(
|
.long_help(
|
||||||
"Execute the given command once, with all search results as arguments.\n\
|
"Execute the given command once, with all search results as arguments.\n\
|
||||||
|
The order of the arguments is non-deterministic, and should not be relied upon.\n\
|
||||||
One of the following placeholders is substituted before the command is executed:\n \
|
One of the following placeholders is substituted before the command is executed:\n \
|
||||||
'{}': path (of all search results)\n \
|
'{}': path (of all search results)\n \
|
||||||
'{/}': basename\n \
|
'{/}': basename\n \
|
||||||
|
|
Loading…
Reference in New Issue
Block a user