From 762c102d24e63d1cf1a3d65543879c9847197b6c Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Jun 03 2011 03:09:31 +0000 Subject: Update cli_getFilesList.sh: - Add support to `--mindepth' option. --- diff --git a/Scripts/Functions/cli_getFilesList.sh b/Scripts/Functions/cli_getFilesList.sh index 003bebd..d1b9df8 100755 --- a/Scripts/Functions/cli_getFilesList.sh +++ b/Scripts/Functions/cli_getFilesList.sh @@ -29,7 +29,7 @@ function cli_getFilesList { local ARGSS='' # Define long options. - local ARGSL='pattern:,maxdepth:,type:,uid:' + local ARGSL='pattern:,mindepth:,maxdepth:,type:,uid:' # Initialize arguments with an empty value and set it as local # variable to this function scope. @@ -63,6 +63,11 @@ function cli_getFilesList { shift 2 ;; + --mindepth ) + OPTIONS="$OPTIONS -mindepth $2" + shift 2 + ;; + --type ) OPTIONS="$OPTIONS -type $2" shift 2 @@ -101,7 +106,7 @@ function cli_getFilesList { # regular expresion so it could be possible to use path expansion. # Using path expansion reduce the amount of places to find out # things and so the time required to finish the task. - PATTERN="^.+/${PATTERN}$" + PATTERN="^.*(/)?${PATTERN}$" # Define list of files to process. At this point we cannot verify # whether the LOCATION is a directory or a file since path