diff options
author | Chris Johns <chrisj@rtems.org> | 2014-05-09 21:50:37 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-06-18 16:48:08 +1200 |
commit | 100f517ab37265acdf067e36b6860020ec8b2184 (patch) | |
tree | 2316c8b888e11dcbcfbfc66a0c1e31991ea20656 /tester/covoar/mkExplanation | |
parent | 4.11: Add ntp patch. (diff) | |
download | rtems-tools-100f517ab37265acdf067e36b6860020ec8b2184.tar.bz2 |
covoar: Merger the covoar source from rtems-testing.git.
Use waf to build covoar.
Diffstat (limited to 'tester/covoar/mkExplanation')
-rwxr-xr-x | tester/covoar/mkExplanation | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/tester/covoar/mkExplanation b/tester/covoar/mkExplanation new file mode 100755 index 0000000..6aa7940 --- /dev/null +++ b/tester/covoar/mkExplanation @@ -0,0 +1,70 @@ +#! /bin/sh +# +# Script to help generate an explanation for the covoar explanations file. +# + +toggle() +{ + case $1 in + no) echo "yes" ;; + yes) echo "no" ;; + *) fatal "Unknown value to toggle ($1)" ;; + esac +} + +usage() +{ + echo "$progname -r sourceLine -c category [-m message|-M msgfile] " + exit 1 +} + +message= +messageFile= +category= +sourceLine= +verbose=no +while getopts c:m:M:r:v OPT +do + case "$OPT" in + c) category=$OPTARG ;; + m) message=$OPTARG ;; + M) messageFile=$OPTARG ;; + r) sourceLine=$OPTARG ;; + v) verbose=`toggle ${verbose}` ;; + *) usage ;; + esac +done + +# Error check +if [ "X${sourceLine}" = "X" ] ; then + echo No sourceLine provided + usage +fi + +let $((shiftcount = $OPTIND - 1)) +shift #shiftcount + +args=$* + +if [ "X${category}" = "X" ] ; then + echo No category provided + usage +fi + +if [ "X${message}" = "X" -a "X${messageFile}" = "X" ] ; then + echo No message provided + usage +fi + +# Generate the explanation +echo ${sourceLine} +echo ${category} +if [ "X${message}" = "X" ] ; then + cat ${messageFile} +else + echo ${message} | xargs -s 76 +fi +echo "+++" +echo + +exit 0 |