#!/bin/sh
# Filename: romver
# 	Generate rom version information.
#
#	This is a script wrapper around flashutil.
#	From DIAG1.2.1, flashutil has the rom version report
#	facility. This script merely maps the options supported
#	by romver until DIAG1.2 to those of DIAG1.2.1 flashutil. 
#	The only option that does not map is -x (checksum).
#
#	But DIAG1.2.1 flashutil provides more options to specify
#	version on the command line. See flashutil man page for
#	details.
#
# Usage:
#     romver [ -d ] [ -f ] [ -h ] [ -n start_node[..end_node ] ] [-v ]	
#
#	 start_node and end_node are specified as cumulative node
#	 numbers.
#
# Modification History:
#
# $Log: romver,v $
# Revision 1.1  1994/05/11  19:09:40  mouli
# Initial revision
#
#
#
#######################################################################
#
# What string:
#
# @(#) romver DIAG_REL_2.0 Thu Jan  5 12:04:09 PST 1995
#
##############################################################################


usage()
{
	echo "Usage: $0 [options]"
	echo
	echo "options:"
	echo "	-d debug"
	echo "	-f force (reset with no confirmation)"
	echo "	-h display this information"
	echo "	-i don't Init nodes"
	echo "	-n Node#"
	echo "	-v Verbose"
	echo "For more options, see flashutil"
	exit
}

#
# Process and validate arguments 
set - - `getopt dfhin:v $*`
if [ $? != 0 ] ; then
	usage
fi
optstr="-r"
for i in $*
do
       case $i in
		-d)
			optstr="$optstr -d"; shift; ;;
		-h)
			usage;;
		-i)
			optstr="$optstr -i"
			shift;;
     		-f)
			optstr="$optstr -f"
			shift;;
		-v)
			optstr="$optstr -v"
			shift;;
		-n)
			optstr="$optstr -s $3"
			shift;shift;;
	       --)      
			shift;    break;;
       esac
done
flashutil $optstr
