ENH: foamCleanPath quick exit on empty 'path'

This commit is contained in:
Mark Olesen
2011-03-25 18:20:34 +01:00
parent e40c0c6521
commit e2cf8f5cf3

View File

@ -52,6 +52,11 @@ options:
- elements whose start matches one of the wildcard(s) - elements whose start matches one of the wildcard(s)
- inaccessible directories (with the -strip (at your option) - inaccessible directories (with the -strip (at your option)
Exit status
0 on success
1 for miscellaneous errors.
2 initial value of 'path' is empty
USAGE USAGE
exit 1 exit 1
} }
@ -81,6 +86,9 @@ done
dirList="$1" dirList="$1"
shift shift
[ -n "$1" ] || exit 2 # quick exit on empty 'dirList'
##DEBUG echo "input>$dirList<" 1>&2 ##DEBUG echo "input>$dirList<" 1>&2
# preserve current IFS and split on colon or whitespace # preserve current IFS and split on colon or whitespace