5 Usage: $0 [-f] <name>.<ext> [<author>]
7 Will add the file with that name to the current directory by copying
8 the appropriate template and replacing the @NAME@ placeholders
11 <ext> needs to be one of
15 cc non-inline non-template code
16 cci inline non-template code
17 ct non-inline template code
18 cti inline template code
19 mpp special Boost.Preprocessor sourcefile (external iteration)
20 dox additional doxygen documentation file
22 If <author> is given, it is also set correctly replaced. If <author>
23 is unset but the environment variable SENF_AUTHOR is set, it's value
24 is used. Otherwise, the @AUTHOR@ placeholder will need to be replaced
27 $0 will refrain from overwriting existing files except when the '-f'
33 base="`dirname "$0"`"; base="`cd "$base"; pwd`"
35 if [ "$1" == "-f" ]; then
40 name="`basename "$1"`"
42 *.*) type=".${name#*.}"; name="${name%.$type}" ;;
46 if [ ! -r "$base/Example$type" ] ; then
47 echo "Don't know about file type '$type'"
51 [ -z "$2" ] || SENF_AUTHOR="$2"
53 if [ -z "$force" -a -r "$1" ] ; then
54 echo "Target file '$1' exists."
58 sed -e "s/@NAME@/$name/g" -e "s/@AUTHOR@/${SENF_AUTHOR:-@AUTHOR@}/g" \
59 < "$base/Example$type" \
63 svn propset svn:keywords "Author Date Id Revision" "$1"