aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2013-05-14 17:20:35 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2013-05-14 17:20:35 +0200
commit6782f48ccb00eab710dc2985e51248c0a7519b89 (patch)
treeb737c1f640ed2e4426e393fca56fa499bceb4450
parentc3cf1e30a3022453311a7e9fe11d94c7a381640e (diff)
downloadbusybox-w32-6782f48ccb00eab710dc2985e51248c0a7519b89.tar.gz
busybox-w32-6782f48ccb00eab710dc2985e51248c0a7519b89.tar.bz2
busybox-w32-6782f48ccb00eab710dc2985e51248c0a7519b89.zip
find: support -HLP
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--findutils/find.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/findutils/find.c b/findutils/find.c
index 2235b5049..d4b7c8ec8 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -231,12 +231,13 @@
231//kbuild:lib-$(CONFIG_FIND) += find.o 231//kbuild:lib-$(CONFIG_FIND) += find.o
232 232
233//usage:#define find_trivial_usage 233//usage:#define find_trivial_usage
234//usage: "[PATH]... [OPTIONS] [ACTIONS]" 234//usage: "[-HL] [PATH]... [OPTIONS] [ACTIONS]"
235//usage:#define find_full_usage "\n\n" 235//usage:#define find_full_usage "\n\n"
236//usage: "Search for files and perform actions on them.\n" 236//usage: "Search for files and perform actions on them.\n"
237//usage: "First failed action stops processing of current file.\n" 237//usage: "First failed action stops processing of current file.\n"
238//usage: "Defaults: PATH is current directory, action is '-print'\n" 238//usage: "Defaults: PATH is current directory, action is '-print'\n"
239//usage: "\n -follow Follow symlinks" 239//usage: "\n -L,-follow Follow symlinks"
240//usage: "\n -H ...on command line only"
240//usage: IF_FEATURE_FIND_XDEV( 241//usage: IF_FEATURE_FIND_XDEV(
241//usage: "\n -xdev Don't descend directories on other filesystems" 242//usage: "\n -xdev Don't descend directories on other filesystems"
242//usage: ) 243//usage: )
@@ -1254,7 +1255,15 @@ int find_main(int argc UNUSED_PARAM, char **argv)
1254 1255
1255 INIT_G(); 1256 INIT_G();
1256 1257
1257 argv++; 1258 /* "+": stop on first non-option */
1259 i = getopt32(argv, "+HLP");
1260 if (i & (1<<0))
1261 G.recurse_flags |= ACTION_FOLLOWLINKS_L0 | ACTION_DANGLING_OK;
1262 if (i & (1<<1))
1263 G.recurse_flags |= ACTION_FOLLOWLINKS | ACTION_DANGLING_OK;
1264 /* -P is default and is ignored */
1265 argv += optind;
1266
1258 for (firstopt = 0; argv[firstopt]; firstopt++) { 1267 for (firstopt = 0; argv[firstopt]; firstopt++) {
1259 if (argv[firstopt][0] == '-') 1268 if (argv[firstopt][0] == '-')
1260 break; 1269 break;