find: tweak error message
big find:
find: missing argument to `-exec'
we now say
find: -exec requires an argument
instead of the cryptic message we emitted previously.
Additional benefit is that it's now 23 bytes smaller.
Add TODO to add '-exec {} +' support
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
This commit is contained in:
1 parent
8031848938
commit
2e73d84c02
1 file changed
+6
-2
+6
-2
@@ -674,10 +674,14 @@ static action*** parse_params(char **argv)
|
|||||||
ap->exec_argv = ++argv; /* first arg after -exec */
|
ap->exec_argv = ++argv; /* first arg after -exec */
|
||||||
ap->exec_argc = 0;
|
ap->exec_argc = 0;
|
||||||
while (1) {
|
while (1) {
|
||||||
if (!*argv) /* did not see ';' until end */
|
if (!*argv) /* did not see ';' or '+' until end */
|
||||||
bb_error_msg_and_die("-exec CMD must end by ';'");
|
bb_error_msg_and_die(bb_msg_requires_arg, "-exec");
|
||||||
if (LONE_CHAR(argv[0], ';'))
|
if (LONE_CHAR(argv[0], ';'))
|
||||||
break;
|
break;
|
||||||
|
//TODO: implement {} + (like xargs)
|
||||||
|
// See:
|
||||||
|
// find findutils/ -exec echo ">"{}"<" \;
|
||||||
|
// find findutils/ -exec echo ">"{}"<" +
|
||||||
argv++;
|
argv++;
|
||||||
ap->exec_argc++;
|
ap->exec_argc++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user