#!/bin/csh -f
#>
#> PACT-GET-TAG - Get the tag of the source repository header
#>
#> Usage:   pact-get-tag [-h] [-d]
#>
#> Options:
#>    -h         Help package 
#>
#>    -d         Get the "date" only portion of the Code tag.
#>
#
# Modification History:
#   07-21-95  Jan Moura, LLNL:  Extended prolog/Help package.
####################
#
#

# see PCD for the reason for this
set Here = `pwd` ; cd ; set RealHome = `pwd` ; cd $Here ; unset $Here

set Base        = `pwd | sed "s|$RealHome|$home|"`
set HelpCode    = $Base/$0

set help     = "FALSE"
set DateOnly = "FALSE"

while ($#argv > 0)
   switch ($argv[1])
      case -h:
               set help = "TRUE"
               breaksw
      case -d:
               set DateOnly = "TRUE"
               breaksw
      default:
               set help = "TRUE"
   endsw
   shift
end


if ($help == "TRUE") then
   goto Help
endif


if ($DateOnly == "TRUE") then
   expr "`cvs history -T -a | tail -1`"  : '.*\[.\(.*_.*_.*\)_.*_.*_.*'

else
   expr "`cvs history -T -a | tail -1`"  : '.*\[\(.*_.*_.*_.*_.*_.*\):.*'

endif


exit($status)


Help:
   awk '($1 == "#>") {print}' $HelpCode      #Print Usage:
   exit(1)
