#!/bin/csh
#
#   You need to set the GMSFILE variable below.
setenv GMSFILE /home/brian/gamess
#
#   This is VB2000 help utility, modelled on gmshelp the GAMESS
#   Unix on-line help - written by Greg Atchity, 25 March 1993.
#
#   This script makes it simple to display the VB2000 input keywords
#   from a text version of part of the VB2000 manual, in the spirit of 
#   the Unix 'man' command.
#   Plain text, quickly displayed, and just as quickly exited.
#
#   This script should be made available to all users, which is very easy:
#      a) make sure that VB-help-file is world readable:-
#         chmod 644 VB-help-file
#      b) change the 'doc' variable to point to your site's actual file name
#      c) make it available, e.g. 'alias vbhelp /full/path/to/vbhelp',
#         or copy it to a location such as /usr/local/bin on people's path.
#
#   Note that the little known "b" subcommand to 'more' will allow you
#   to read backwards, just as a "space bar" lets you read forward.  The
#   only  other 'more' subcommand you need to know is "q" for quit!
#
set doc=$GMSFILE/vb2000/DOC/VB-help-file

if ($1 == '-h' | $1 == '-H') then
  set me=$0
  echo Usage: $0 \[command-name\]
  echo " "
  echo Don\'t include the dollar sign in the namelist group.
  echo " "
  echo $me:t uses the pager "'more'" by default but will work with "'pg'"
  echo or "'less'" by putting one of those pagers in your PAGER environment
  echo variable.
  echo " "
  echo You can not type in a comand-name that starts with "##" such as
  echo \#\#VBSTR. Use 01VBSTR instead.
  exit 0
endif

if ($?PAGER) then
   set pager=$PAGER
else
   set pager=more
endif

#--set key=`echo $1 | tr "[a-z]" "[A-Z]"`  # English-centric case ranges

if ($#argv == 0) then
   $pager $doc
else
   set key=`echo $1 | tr '[:lower:]' '[:upper:]'`
   set key2=`echo $key | sed "s/[0-9][0-9]/##/g"`
   $pager "+/^.$key2" $doc
endif
