File: msg_parse_001.sh

package info (click to toggle)
cod-tools 3.7.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 154,792 kB
  • sloc: perl: 57,588; sh: 36,842; ansic: 6,402; xml: 1,982; yacc: 1,117; makefile: 727; python: 166
file content (20 lines) | stat: -rwxr-xr-x 656 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
##
# Tests the way error messages are formed when using COD::UserMessage
# module in command-line perl as well as reading from SDTIN as input file.
##

#BEGIN DEPEND------------------------------------------------------------------
INPUT_MODULE='src/lib/perl5/COD/UserMessage.pm'
#END DEPEND--------------------------------------------------------------------

echo "test error" | \
perl -e 'use COD::UserMessage qw( error );' \
     -e 'print "$ARGV";' \
     -e 'while (<>) {' \
     -e '    error( {' \
     -e '       program  => $0,' \
     -e '       filename => $ARGV,' \
     -e '       message  => $_' \
     -e '    } );' \
     -e '}'