* find/find.1 - Fix explanation of -prune SCM example and make it efficient * doc/find.texi - Make -prune SCM example efficient --- NEWS | 5 +++++ doc/find.texi | 6 +++--- find/find.1 | 19 ++++++++++++++----- 3 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/NEWS b/NEWS index dffca5aa..b3f2074c 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,11 @@ GNU findutils NEWS - User visible changes. -*- outline -*- (allout) findutils now builds again on systems with musl-libc. This requires gettext-0.19.8. +** Documentation Changes + + The find.1 manual and the Texinfo manual -prune SCM example has + been corrected (manual) and made much more efficient (both) [#62259] + * Noteworthy changes in release 4.9.0 (2022-02-22) [stable] diff --git a/doc/find.texi b/doc/find.texi index 1f295837..8c3972d4 100644 --- a/doc/find.texi +++ b/doc/find.texi @@ -5139,9 +5139,9 @@ already found. @smallexample find repo/ \ --exec test -d @{@}/.svn \; -or \ --exec test -d @{@}/.git \; -or \ --exec test -d @{@}/CVS \; -print -prune + -type d \ + -exec test -d @{@}/.svn -o -d @{@}/.git -o -d @{@}/CVS \; \ + -print -prune @end smallexample In this example, @command{test} is used to tell if we are currently diff --git a/find/find.1 b/find/find.1 index 429aa2f0..f5fa4eee 100644 --- a/find/find.1 +++ b/find/find.1 @@ -2494,15 +2494,14 @@ projects' roots: .in +4m .B $ find repo/ \e .in +4m -.B \e( \-exec test \-d \(aq{}/.svn\(aq \e; \e -.B \-or \-exec test \-d \(aq{}/.git\(aq \e; \e -.B \-or \-exec test \-d \(aq{}/CVS\(aq \e; \e -.B \e) \-print \-prune +.B \-type d \e +.B \-exec test \-d \(aq{}/.svn\(aq \-o \-d \(aq{}/.git\(aq \-o \-d \(aq{}/CVS\(aq \e; \e +.B \-print \-prune .in -4m .in -4m \& .fi -Sample output: +Sample directories: .nf \& .in +4m @@ -2513,6 +2512,16 @@ Sample output: .B repo/project4/.git .in \& +Sample output: +.nf +\& +.in +4m +.B repo/project1 +.B repo/gnu/project2 +.B repo/gnu/project3 +.B repo/project4 +.in +\& .fi In this example, .B \-prune -- 2.30.2