+ else if (strcmp(argv[i], "-name") == 0) {
+ if (++i == argc)
+ error_msg_and_die("option `-name' requires an argument");
+ pattern = argv[i];
+#ifdef BB_FEATURE_FIND_TYPE
+ } else if (strcmp(argv[i], "-type") == 0) {
+ if (++i == argc)
+ error_msg_and_die("option `-type' requires an argument");
+ type_mask = find_type(argv[i]);
+#endif
+#ifdef BB_FEATURE_FIND_PERM
+ } else if (strcmp(argv[i], "-perm") == 0) {
+ char *end;
+ if (++i == argc)
+ error_msg_and_die("option `-perm' requires an argument");
+ perm_mask = strtol(argv[i], &end, 8);
+ if (end[0] != '\0')
+ error_msg_and_die("invalid argument `%s' to `-perm'", argv[i]);
+ if (perm_mask > 07777)
+ error_msg_and_die("invalid argument `%s' to `-perm'", argv[i]);
+ if ((perm_char = argv[i][0]) == '-')
+ perm_mask = -perm_mask;
+#endif
+#ifdef BB_FEATURE_FIND_MTIME
+ } else if (strcmp(argv[i], "-mtime") == 0) {
+ char *end;
+ if (++i == argc)
+ error_msg_and_die("option `-mtime' requires an argument");
+ mtime_days = strtol(argv[i], &end, 10);
+ if (end[0] != '\0')
+ error_msg_and_die("invalid argument `%s' to `-mtime'", argv[i]);
+ if ((mtime_char = argv[i][0]) == '-')
+ mtime_days = -mtime_days;
+#endif
+ } else
+ show_usage();