#!/bin/sh 
#--------------------------- Shell MegaWave2 Macro --------------------------#
_sccsid="%Z%MegaWave2 %R%, %M% %I%, %G%";
_Prog="`basename $0`"
_Vers="2.0"
_Date="1999"
_Func="Return the current MegaWave2 version number"
_Auth="Jacques Froment";
_Usage="[-major || -minor || -variant]"
#----------------------------------------------------------------------------#
# This file is part of the MegaWave2 system macros. 
# MegaWave2 is a "soft-publication" for the scientific community. It has
# been developed for research purposes and it comes without any warranty.
# The last version is available at http://www.cmla.ens-cachan.fr/Cmla/Megawave
# CMLA, Ecole Normale Superieure de Cachan, 61 av. du President Wilson,
#       94235 Cachan cedex, France. Email: megawave@cmla.ens-cachan.fr 
#-----------------------------------------------------------------------------

# Usage
if [ $# -gt 1 ]; then
  . .mw2_help_lg_com
fi

f=1-3
while [ "$1" != "" ]
do
  case "$1" in
    -major)     f=1
                ;;

    -minor)     f=2
                ;;

    -variant)   f=3
                ;;

       
    *)          echo "arg \"$1\" cannot be used in `basename $0`"
                . .mw2_help_lg_com
                exit 1
                ;;
  esac
  shift
done


if [ "${MEGAWAVE2}" = "" ]; then
   echo "\$MEGAWAVE2 environment variable is not set !"
   exit 1
fi

V=$MEGAWAVE2/VERS
if [ ! -r $V ]; then
  echo "Cannot read version number in $V !"
  exit 1
fi

cat $V | cut -f $f -d "."

exit 0

