diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2003-08-13 21:41:34 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2003-08-13 21:41:34 (GMT) |
commit | 779af14613558c6f3f470d80576d45623017aab3 (patch) | |
tree | f9c8ec1c2886cdfa0d47ee2162bd0ec3820957cc /bin | |
parent | c16a0fa8d3a6a1e5b27b94543966a7f03052ad19 (diff) | |
download | hdf5-779af14613558c6f3f470d80576d45623017aab3.zip hdf5-779af14613558c6f3f470d80576d45623017aab3.tar.gz hdf5-779af14613558c6f3f470d80576d45623017aab3.tar.bz2 |
[svn-r7359] Purpose:
New features
Description:
Add options of verbose (-v, -v9) and -fname which limits to
checking file with the file name pattern.
Solution:
Platforms tested:
Did not h5committest which does not cover this command.
Verified it by hand.
Misc. update:
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/chkcopyright | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/bin/chkcopyright b/bin/chkcopyright index 53f1478..c217743 100755 --- a/bin/chkcopyright +++ b/bin/chkcopyright @@ -31,11 +31,17 @@ DIRS=. # default current directory USAGE() { cat <<EOF -Usage: $PROGNAME [-h | -help] [dir1 dir2 ...] +Usage: $PROGNAME [-h | -help] [-fname name-patter] [-v | -v9] [dir1 dir2 ...] Check copyright notices of files in [dir1 dir2 ...}. Default is to check files in current directory. -h | -help show this page. + -fname name-pattern + limit to files of name-pattern + -v + verbose mode + -v9 + highly verbose EOF } @@ -50,6 +56,16 @@ PARSE_OPTION() USAGE exit 0 ;; + -fname ) + shift + FNAME="$1" + ;; + -v* ) + VERBOSE=yes + if test X$1 = X-v9; then + set -x + fi + ;; -* ) echo "***Unknown option ($1)" USAGE @@ -227,11 +243,21 @@ EOF # # Main body -PARSE_OPTION $* +PARSE_OPTION "$@" -find $DIRS -type f -print | +# use find to list all those file names and process them +# one by one. +( +if test -z "$FNAME" ; then + find $DIRS -type f -print +else + find $DIRS -type f -name "${FNAME}" -print +fi +) | while read file; do - #echo checking ${file}... + if test X-$VERBOSE = X-yes; then + echo checking ${file}... + fi case ${file} in *.c | *.h | *.cpp ) C_SOURCE ${file} |