findutils-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Findutils-patches] [PATCH] find: add '-D all' to enable all debug flags


From: Bernhard Voelker
Subject: [Findutils-patches] [PATCH] find: add '-D all' to enable all debug flags
Date: Fri, 2 Nov 2018 15:55:15 +0100

* find/defs.h (DebugOption): Add DebugAll, which includes all other
debug options but DebugHelp.
* find/util.c (debugassoc): Add an entry for DebugAll, and move DebugHelp
to the end.
* doc/find.texi (node Debug Options): Document the new option.
* find/find.1: Likewise.
* NEWS (Improvements): Likewise.
---
 NEWS          |  3 +++
 doc/find.texi | 10 +++++++---
 find/defs.h   |  4 +++-
 find/find.1   |  7 +++++--
 find/util.c   |  6 ++++--
 5 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/NEWS b/NEWS
index 98d22501..02745da8 100644
--- a/NEWS
+++ b/NEWS
@@ -42,6 +42,9 @@ find now outputs a better hint in case the user passed an 
unquoted shell-
 glob pattern to options like -name, i.e., when the offending argument is
 an existing file.
 
+find now supports the debug option '-D all' to include all of the other
+debug options at once.
+
 xargs now supports the -o, --open-tty option to reopen stdin as /dev/tty
 in the child process before executing the command; useful to run an
 interactive application.  Added for compatibility with BSD.
diff --git a/doc/find.texi b/doc/find.texi
index 1e15d939..fda89e9e 100644
--- a/doc/find.texi
+++ b/doc/find.texi
@@ -3384,10 +3384,10 @@ most people will not find this option helpful.
 The list of debug options should be comma separated.  Compatibility of
 the debug options is not guaranteed between releases of findutils.
 For a complete list of valid debug options, see the output of
address@hidden -D help}.  Valid debug options include:
address@hidden -D help}.
+
+Valid debug options include:
 @table @samp
address@hidden help
-Explain the debugging options.
 @item tree
 Show the expression tree in its original and optimised form.
 @item stat
@@ -3399,6 +3399,10 @@ expression tree; see the @samp{-O} option.
 @item rates
 Prints a summary indicating how often each predicate succeeded or
 failed.
address@hidden all
+Enable all of the other debug options (but @samp{help}).
address@hidden help
+Explain the debugging options.
 @end table
 
 @node Find Expressions
diff --git a/find/defs.h b/find/defs.h
index 63f3b2a3..f4ce0c59 100644
--- a/find/defs.h
+++ b/find/defs.h
@@ -548,7 +548,9 @@ enum DebugOption
     DebugHelp             = 1 << 4,
     DebugExec             = 1 << 5,
     DebugSuccessRates     = 1 << 6,
-    DebugTime             = 1 << 7
+    DebugTime             = 1 << 7,
+
+    DebugAll              = ~DebugNone & ~DebugHelp, /* all but help */
   };
 
 struct options
diff --git a/find/find.1 b/find/find.1
index 67fdd537..ae2f1f8b 100644
--- a/find/find.1
+++ b/find/find.1
@@ -219,8 +219,6 @@ Valid debug options include
 .RS
 .IP exec
 Show diagnostic information relating to \-exec, \-execdir, \-ok and \-okdir
-.IP help
-Explain the debugging options.
 .IP opt
 Prints diagnostic information relating to the optimisation of the
 expression tree; see the \-O option.
@@ -239,6 +237,11 @@ system calls.  The
 program tries to minimise such calls.
 .IP tree
 Show the expression tree in its original and optimised form.
+.IP all
+Enable all of the other debug options (but
+.BR help ).
+.IP help
+Explain the debugging options.
 .RE
 .IP \-Olevel
 Enables query optimisation.
diff --git a/find/util.c b/find/util.c
index fa338074..c00f8014 100644
--- a/find/util.c
+++ b/find/util.c
@@ -55,13 +55,15 @@ struct debug_option_assoc
 static struct debug_option_assoc debugassoc[] =
   {
     { "exec", DebugExec, "Show diagnostic information relating to -exec, 
-execdir, -ok and -okdir" },
-    { "help", DebugHelp, "Explain the various -D options" },
     { "opt",  DebugExpressionTree|DebugTreeOpt, "Show diagnostic information 
relating to optimisation" },
     { "rates", DebugSuccessRates, "Indicate how often each predicate 
succeeded" },
     { "search",DebugSearch, "Navigate the directory tree verbosely" },
     { "stat", DebugStat, "Trace calls to stat(2) and lstat(2)" },
     { "time", DebugTime, "Show diagnostic information relating to time-of-day 
and timestamp comparisons" },
-    { "tree", DebugExpressionTree, "Display the expression tree" }
+    { "tree", DebugExpressionTree, "Display the expression tree" },
+
+    { "all", DebugAll, "Set all of the debug flags (but help)" },
+    { "help", DebugHelp, "Explain the various -D options" },
   };
 #define N_DEBUGASSOC (sizeof(debugassoc)/sizeof(debugassoc[0]))
 
-- 
2.19.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]