#!/bin/csh -f
#+
# apropos -- parse DEIMOS command help for requested string
#
# Purpose:
#	Generate a summary of DEIMOS script commands which match a
#	given string.
#
# Usage:
#	apropos <string>
# 
# Arguments:
#	string = a text string to be searched for in the output of "help"
# 
# Output:
#	to stdout
# 
# Restrictions:
#	Must be run on polo
# 
# Exit values:
#	 0 = normal completion
#	 1 = wrong number of arguments
#
# Example:
#	1) Search for commands related to the TV guider:
#		apropos tv
#
#-
# Modification history:
#	2003-May-29	GDW	Original version
#-----------------------------------------------------------------------

set buf = $0
set cmd = $buf:t
set usage = "Usage: $cmd <string>"

# verify args...
if ( $#argv != 1 ) then
    printf "$usage\n"
    exit 1
endif

# parse args...
if ( $#argv >= 1 ) then
    set string = $1
    shift
endif

# grep the help output...
help | fgrep -i $string | more
