#! /bin/csh

echo "## Bundled source files."
echo "## Execute this file as an argument to csh"

@ i = 1

while ( $i <= $#argv )
    set arg = $argv[$i]
@   i++
    switch($arg)

    case -D:
	set arg = $argv[$i]
@	i++
	echo
	echo "echo Creating subdirectory: $arg..."
	echo "mkdir $arg"
	echo "cd $arg"
	continue

    case -?*:
#	unknown options are ignored
	continue

    default:
	echo
	echo "echo Creating file: $arg..."
	echo "cat > $arg << 'ZZZ'"
	cat $arg
	echo "'ZZZ'"
	continue
    endsw

end
exit 0
