/[libconf]/libconf/perl-Libconf/templates/nagios_template.pm
ViewVC logotype

Diff of /libconf/perl-Libconf/templates/nagios_template.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by logarno, Mon Dec 1 23:43:26 2003 UTC revision 1.3 by dams, Wed Dec 3 00:43:11 2003 UTC
# Line 33  $templates{nagios} = { Line 33  $templates{nagios} = {
33                                         }                                         }
34                                        ),                                        ),
35                                       q(                                       q(
36                                         if ($in =~ s/^\s*define\s+(\S+)\s*{\s*$//) {                                         if ($in =~ s/^\s*define\s+([\w]+)(.*)$/$2/) {
37                                             $atom->{type} = 'SECTION';                                             $atom->{type} = 'SECTION';
38                                             $atom->{section_name} = $1;                                             $atom->{section_name} = $1;
39                                             $atom->{sections} = [ ];                                             $atom->{sections} = [ ];
40                                             $out->{current_sections} = [ { name => $1 } ];                                             $out->{current_sections} = [ { name => $1 } ];
41                                             $matched = 1;                                             $keep_atom = 1;
42                                               $out->{line_continued} = 1;
43                                         }                                         }
44                                       ),                                       ),
45                                       q(                                       q(
46                                          if ($in =~ s/^\s*\{\s*$// && $out->{line_continued}) {                                          if ($out->{line_continued} && $in =~ s/^\s*\{\s*$//) {
47                                               $out->{line_continued} = 0;
48                                             $matched = 1;                                             $matched = 1;
49                                               $keep_atom = 0;
50                                          }                                          }
51                                        ),                                        ),
52                                       q(                                       q(
53                                         if ($in =~ s/^\s*(.*?)(\s+?)\s*(.*)\s*$//) {                                         if ($in =~ s/^\s*(\S+)\s+(.*)\s*$//) {
54                                             $atom->{type} = 'KEY_VALUE';                                             $atom->{type} = 'KEY_VALUE';
55                                             $atom->{key} = $1;                                             $atom->{key} = $1;
56                                             $atom->{value} = [split(/\s*,\s*/, $3)];                                             $atom->{value} = [split(/\s*,\s*/, $2)];
57                                             $atom->{sections} = [ @{$out->{current_sections}} ];                                             $atom->{sections} = [ @{$out->{current_sections}} ];
58                                             $matched = 1;                                             $matched = 1;
59                                         }                                         }
60                                       )                                       )
61                                      ],                                      ],
62                             comments => [ ['#'] ],                             comments => [ ['#'] ],
                            comment_output => q(/^(\s*)$/ ? "$_\n" : "#$_\n"),  
63                             output => {                             output => {
64                                        KEY_VALUE => q(                                        KEY_VALUE => q(
65                                            my ($key, $value) = ($atom->{key}, join(', ', @{$atom->{value}}));                                            my ($key, $value) = ($atom->{key}, join(', ', @{$atom->{value}}));

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26