diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2010-02-25 13:22:37 +0100 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2010-02-25 13:22:37 +0100 |
commit | 2e73d84c02c6dd4945838665ce0167bddbb7f1c8 (patch) | |
tree | 7ef72ebf47297b04245dc348c59f69290a629034 /findutils/find.c | |
parent | 8031848938032b786c71d1fadebea47e5451c19a (diff) |
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>
Diffstat (limited to 'findutils/find.c')
-rw-r--r-- | findutils/find.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/findutils/find.c b/findutils/find.c index 4bc3b38dc..f45abbe36 100644 --- a/findutils/find.c +++ b/findutils/find.c @@ -674,10 +674,14 @@ static action*** parse_params(char **argv) ap->exec_argv = ++argv; /* first arg after -exec */ ap->exec_argc = 0; while (1) { - if (!*argv) /* did not see ';' until end */ - bb_error_msg_and_die("-exec CMD must end by ';'"); + if (!*argv) /* did not see ';' or '+' until end */ + bb_error_msg_and_die(bb_msg_requires_arg, "-exec"); if (LONE_CHAR(argv[0], ';')) break; + //TODO: implement {} + (like xargs) + // See: + // find findutils/ -exec echo ">"{}"<" \; + // find findutils/ -exec echo ">"{}"<" + argv++; ap->exec_argc++; } |