source: rtems-tools/tester/covoar/mkExplanation @ 0c4884a

Last change on this file since 0c4884a was fcef37b, checked in by Joel Sherrill <joel@…>, on 04/06/21 at 20:24:08

covoar: Remove training white spaces

  • Property mode set to 100755
File size: 1.1 KB
Line 
1#! /bin/sh
2#
3#  Script to help generate an explanation for the covoar explanations file.
4#
5
6toggle()
7{
8  case $1 in
9    no)  echo "yes" ;;
10    yes) echo "no" ;;
11    *)   fatal "Unknown value to toggle ($1)" ;;
12  esac
13}
14
15usage()
16{
17  echo "$progname -r sourceLine -c category [-m message|-M msgfile] "
18  exit 1
19}
20
21message=
22messageFile=
23category=
24sourceLine=
25verbose=no
26while getopts c:m:M:r:v OPT
27do
28  case "$OPT" in
29    c) category=$OPTARG ;;
30    m) message=$OPTARG ;;
31    M) messageFile=$OPTARG ;;
32    r) sourceLine=$OPTARG ;;
33    v) verbose=`toggle ${verbose}` ;;
34    *) usage ;;
35  esac
36done
37
38# Error check
39if [ "X${sourceLine}" = "X" ] ; then
40  echo No sourceLine provided
41  usage
42fi
43
44let $((shiftcount = $OPTIND - 1))
45shift #shiftcount
46
47args=$*
48
49if [ "X${category}" = "X" ] ; then
50  echo No category provided
51  usage
52fi
53
54if [ "X${message}" = "X" -a "X${messageFile}" = "X" ] ; then
55  echo No message provided
56  usage
57fi
58
59# Generate the explanation
60echo ${sourceLine}
61echo ${category}
62if [ "X${message}" = "X" ] ; then
63  cat ${messageFile}
64else
65  echo ${message} | xargs -s 76
66fi
67echo "+++"
68echo
69
70exit 0
Note: See TracBrowser for help on using the repository browser.