#!/bin/sh
#BHEADER***********************************************************************
# (c) 2000   The Regents of the University of California
#
# See the file COPYRIGHT_and_DISCLAIMER for a complete copyright
# notice, contact person, and disclaimer.
#
# $Revision: 2.0 $
#EHEADER***********************************************************************

#=============================================================================
# This script prints the hypre version number, date, and time by
# grepping the HYPRE_utilities.h file for the HYPRE_Version macro.
#=============================================================================

case $1 in
    -h|-help) 
        echo 
        echo "$0 [options]"
        echo "  -h|-help       - prints usage information"
        echo "  -number        - prints the version number"
        echo "  -date          - prints the version day"
        echo "  -time          - prints the version day and time"
        echo 
        exit;;
esac

# NOTE: In order to call this script from other directories,
# we need to get the path info from the command line
VPATH=`dirname $0`
VFILE="${VPATH}/HYPRE_utilities.h"
VINFO=`grep HYPRE_Version $VFILE`; \

# this is the no-option print line
VPRINT=`echo $VINFO | awk '{print "hypre Version " $4 " Date: " $6 " " $7}'`

# this defines the print lines for the various options
case $1 in
    -number)
	VPRINT=`echo $VINFO | awk '{print $4}'`;;
    -date)
	VPRINT=`echo $VINFO | awk '{print $6}'`;;
    -time)
	VPRINT=`echo $VINFO | awk '{print $6 " " $7}'`;;
esac

# print the version information
echo $VPRINT
