#!/bin/sh # check-help for VideoteXt # # $Id: check-help,v 1.1 1997/09/14 01:00:41 mb Exp mb $ # # Copyright (c) 1997 Martin Buck # Read COPYING for more information # This script checks whether all XV_HELP_DATA attributes in the sourcecode # have a corresponding entry in the help file. TMPFILE1=/tmp/check_help1_$$ TMPFILE2=/tmp/check_help2_$$ TMPFILE3=/tmp/check_help3_$$ if [ $# -lt 2 ]; then echo "Usage: $0 info-file source-files" >&2 exit 1 fi INFOFILE="$1" shift egrep -h 'XV_HELP_DATA.*"videotext:[a-zA-Z0-9_]+"' "$@" | gawk ' BEGIN { RS = "[ \t,]" } /^"videotext:[a-zA-Z0-9_]+"$/ { gsub(/^"videotext/, ""); gsub(/"$/, ""); print $1 } ' | sort -u > $TMPFILE1 egrep '^:[a-zA-Z0-9_]+$' "$INFOFILE" | sort -u > $TMPFILE2 diff $TMPFILE1 $TMPFILE2 | egrep '^[<>]' | sort -u > $TMPFILE3 cat $TMPFILE3 if [ -s $TMPFILE3 ]; then STATUS=1 else STATUS=0 fi rm -f $TMPFILE1 $TMPFILE2 $TMPFILE3 exit $STATUS