From: Ben Elliston Date: Thu, 22 Nov 2018 22:35:30 +0000 (+1100) Subject: * doc/dejagnu.texi (getdirs procedure): Improve documentation X-Git-Tag: upstream/1.6.2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=389f38092652944c9057bf8965cf2f5ff24c2269;p=platform%2Fupstream%2Fdejagnu.git * doc/dejagnu.texi (getdirs procedure): Improve documentation including documenting the -all option. (find procedure): Fix a typo. * lib/utils.exp (getdirs): Improve comments. --- diff --git a/ChangeLog b/ChangeLog index 2a05040..e70aa62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2018-11-23 Ben Elliston + + * doc/dejagnu.texi (getdirs procedure): Improve documentation + including documenting the -all option. + (find procedure): Fix a typo. + * lib/utils.exp (getdirs): Improve comments. + 2018-11-22 Jacob Bachmeyer * runtest.exp: Ensure that multipass pass variables are always diff --git a/doc/dejagnu.texi b/doc/dejagnu.texi index 70b5c0e..e72118d 100644 --- a/doc/dejagnu.texi +++ b/doc/dejagnu.texi @@ -4539,21 +4539,28 @@ tool, and its version number. @node getdirs procedure, find procedure, , Utility Procedures @subsubsection getdirs Procedure -Returns a list of all the directories in the single directory a single -directory that match an optional pattern. +Returns a list of all the subdirectories in a single directory that +match a glob pattern. @quotation -@t{@b{getdirs}@{@i{rootdir} +@t{@b{getdirs}@{@i{-all} +@i{rootdir} @i{pattern}@}} @end quotation @table @asis -@item @code{args} + +@item @code{-all} +If this option is given, then subdirectories will be matched +recursively. + +@item @code{rootdir} +The top level directory to start the search from. @item @code{pattern} -If you do not specify @code{pattern}, @code{Getdirs} assumes a default -pattern of @emph{*}. You may use the common shell wildcard characters in -the pattern. If no directories match the pattern, then a NULL string is +If you do not specify @code{pattern}, @code{getdirs} uses a default +pattern of @code{*}. You may use the common shell wildcard characters in +the pattern. If no directories match the pattern, then an empty list is returned. @end table @@ -4575,7 +4582,7 @@ pattern, then a NULL string is returned. @table @asis @item @code{rootdir} -The top level directory to search the search from. +The top level directory to start the search from. @item @code{pattern} A csh "glob" style regular expression representing the files to find. diff --git a/lib/utils.exp b/lib/utils.exp index eca82d9..3b94499 100644 --- a/lib/utils.exp +++ b/lib/utils.exp @@ -24,12 +24,10 @@ # Gets the directories in a directory, or in a directory tree. -# args: the first is the dir to look in, the next -# is the pattern to match. It -# defaults to *. Patterns are csh style -# globbing rules +# args: the first is the directory to look in, the next is the +# glob pattern to match (default "*"). # options: -all search the tree recursively -# returns: a list of dirs or NULL; the root directory is not returned. +# returns: a list of directories excluding the root directory # proc getdirs { args } { if { [lindex $args 0] == "-all" } {