aboutsummaryrefslogtreecommitdiff
path: root/findutils
diff options
context:
space:
mode:
Diffstat (limited to 'findutils')
-rw-r--r--findutils/find.c2
-rw-r--r--findutils/grep.c11
-rw-r--r--findutils/xargs.c9
3 files changed, 7 insertions, 15 deletions
diff --git a/findutils/find.c b/findutils/find.c
index 69baf065d..5857a3f44 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -15,7 +15,7 @@
15 * # find file.txt -exec 'echo {}' '{} {}' ';' 15 * # find file.txt -exec 'echo {}' '{} {}' ';'
16 * find: echo file.txt: No such file or directory 16 * find: echo file.txt: No such file or directory
17 * # find file.txt -exec 'echo' '{} {}' '; ' 17 * # find file.txt -exec 'echo' '{} {}' '; '
18 * find: missing argument to `-exec' 18 * find: missing argument to '-exec'
19 * # find file.txt -exec 'echo {}' '{} {}' ';' junk 19 * # find file.txt -exec 'echo {}' '{} {}' ';' junk
20 * find: paths must precede expression 20 * find: paths must precede expression
21 * # find file.txt -exec 'echo {}' '{} {}' ';' junk ';' 21 * # find file.txt -exec 'echo {}' '{} {}' ';' junk ';'
diff --git a/findutils/grep.c b/findutils/grep.c
index 568ab12c2..7c5f73d2f 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -107,6 +107,7 @@
107//usage:#define fgrep_trivial_usage NOUSAGE_STR 107//usage:#define fgrep_trivial_usage NOUSAGE_STR
108//usage:#define fgrep_full_usage "" 108//usage:#define fgrep_full_usage ""
109 109
110/* -e,-f are lists; -m,-A,-B,-C have numeric param */
110#define OPTSTR_GREP \ 111#define OPTSTR_GREP \
111 "lnqvscFiHhe:*f:*Lorm:+wx" \ 112 "lnqvscFiHhe:*f:*Lorm:+wx" \
112 IF_FEATURE_GREP_CONTEXT("A:+B:+C:+") \ 113 IF_FEATURE_GREP_CONTEXT("A:+B:+C:+") \
@@ -686,11 +687,9 @@ int grep_main(int argc UNUSED_PARAM, char **argv)
686 687
687 /* do normal option parsing */ 688 /* do normal option parsing */
688#if ENABLE_FEATURE_GREP_CONTEXT 689#if ENABLE_FEATURE_GREP_CONTEXT
689 /* -H unsets -h; -C unsets -A,-B; -e,-f are lists; 690 /* -H unsets -h; -C unsets -A,-B */
690 * -m,-A,-B,-C have numeric param */
691 opt_complementary = "H-h:C-AB";
692 opts = getopt32(argv, 691 opts = getopt32(argv,
693 OPTSTR_GREP, 692 "^" OPTSTR_GREP "\0" "H-h:C-AB",
694 &pattern_head, &fopt, &max_matches, 693 &pattern_head, &fopt, &max_matches,
695 &lines_after, &lines_before, &Copt); 694 &lines_after, &lines_before, &Copt);
696 695
@@ -716,9 +715,7 @@ int grep_main(int argc UNUSED_PARAM, char **argv)
716 } 715 }
717#else 716#else
718 /* with auto sanity checks */ 717 /* with auto sanity checks */
719 /* -H unsets -h; -c,-q or -l unset -n; -e,-f are lists; -m N */ 718 getopt32(argv, "^" OPTSTR_GREP "\0" "H-h:c-n:q-n:l-n:", // why trailing ":"?
720 opt_complementary = "H-h:c-n:q-n:l-n:";
721 getopt32(argv, OPTSTR_GREP,
722 &pattern_head, &fopt, &max_matches); 719 &pattern_head, &fopt, &max_matches);
723#endif 720#endif
724 invert_search = ((option_mask32 & OPT_v) != 0); /* 0 | 1 */ 721 invert_search = ((option_mask32 & OPT_v) != 0); /* 0 | 1 */
diff --git a/findutils/xargs.c b/findutils/xargs.c
index e5384d14c..97afef039 100644
--- a/findutils/xargs.c
+++ b/findutils/xargs.c
@@ -508,13 +508,8 @@ int xargs_main(int argc, char **argv)
508 508
509 INIT_G(); 509 INIT_G();
510 510
511#if ENABLE_DESKTOP && ENABLE_LONG_OPTS 511 opt = getopt32long(argv, OPTION_STR,
512 /* For example, Fedora's build system uses --no-run-if-empty */ 512 "no-run-if-empty\0" No_argument "r",
513 applet_long_options =
514 "no-run-if-empty\0" No_argument "r"
515 ;
516#endif
517 opt = getopt32(argv, OPTION_STR,
518 &max_args, &max_chars, &G.eof_str, &G.eof_str 513 &max_args, &max_chars, &G.eof_str, &G.eof_str
519 IF_FEATURE_XARGS_SUPPORT_REPL_STR(, &G.repl_str, &G.repl_str) 514 IF_FEATURE_XARGS_SUPPORT_REPL_STR(, &G.repl_str, &G.repl_str)
520 ); 515 );