- # Need to change characters that SGML doesn't like at this point.
- # Perhaps we should use a function for each of these variables?
- # Deal with < and >
- $help{$cmd}{command} =~ s/</</g ;
- $help{$cmd}{command} =~ s/>/>/g ;
- # Deal with [ and ]
- $help{$cmd}{command} =~ s/\[/[/g ;
- $help{$cmd}{command} =~ s/\]/]/g ;
- # Change to lower case
- $help{$cmd}{command} = lc($help{$cmd}{command}) ;
-
- # Deal with < and >
- $help{$cmd}{description} =~ s/</</g ;
- $help{$cmd}{description} =~ s/>/>/g ;
-
- # Deal with < and >
- if($help{$cmd}{comment})
- {
- $help{$cmd}{comment} =~ s/</</g ;
- $help{$cmd}{comment} =~ s/>/>/g ;
- }
-
- # Output the section details and command summary.
- print("<sect1>$help{$cmd}{command}") ;
- if($level > 0) { print(" ($help{$cmd}{level})") ; }
- print("\n\n") ;
- print("<P>\n") ;
- print("<tt>\n") ;
- print("<bf>$help{$cmd}{command}</bf> $help{$cmd}{description}\n") ;
- print("</tt>\n") ;
- print("\n") ;
-
- # Output the command comments.
- print("<P>\n") ;
-
- # Loop through each line of the command comments.
- # If the first character of the line is whitespace, then use tscreen
- # Once a tscreen block has started, continue until the next blank line.
- my $block = 0 ;
-
- # Is the comment field blank? Then trying to split will error - lets not.
- if(!$help{$cmd}{comment})
- {
- next;
- }
-
- # Work through the comments line by line
- foreach $line (split('\n', $help{$cmd}{comment}))
- {
- # Leading whitespace or not?
- if($line =~ m/^\s+\S+/)
- {
- if(!$block)
- {
- $block = 1 ;
- print("<tscreen><verb>\n") ;
- }
- }
- else
- {
- if($block)
- {
- $block = 0 ;
- print("</verb></tscreen>\n") ;
- }
- }
- print("$line\n") ;
- }
+ # Need to change characters that SGML doesn't like at this point.
+ # Perhaps we should use a function for each of these variables?
+ # Deal with < and >
+ $help{$cmd}{command} =~ s/</</g ;
+ $help{$cmd}{command} =~ s/>/>/g ;
+
+ # Deal with [ and ]
+ $help{$cmd}{command} =~ s/\[/[/g ;
+ $help{$cmd}{command} =~ s/\]/]/g ;
+
+ # Change to lower case
+ $help{$cmd}{command} = lc($help{$cmd}{command}) ;
+
+ # Deal with < and >
+ $help{$cmd}{description} =~ s/</</g ;
+ $help{$cmd}{description} =~ s/>/>/g ;
+
+ # Deal with < and >
+ if ($help{$cmd}{comment}) {
+ $help{$cmd}{comment} =~ s/</</g ;
+ $help{$cmd}{comment} =~ s/>/>/g ;
+ }
+
+ # Output the section details and command summary.
+ print("<sect1>$help{$cmd}{command}") ;
+ print(" ($help{$cmd}{level})") if $level > 0;
+ print("\n\n") ;
+ print("<P>\n") ;
+ print("<tt>\n") ;
+ print("<bf>$help{$cmd}{command}</bf> $help{$cmd}{description}\n") ;
+ print("</tt>\n") ;
+ print("\n") ;
+
+ # Output the command comments.
+ print("<P>\n") ;
+
+ # Loop through each line of the command comments.
+ # If the first character of the line is whitespace, then use tscreen
+ # Once a tscreen block has started, continue until the next blank line.
+ my $block = 0 ;
+
+ # Is the comment field blank? Then trying to split will error - lets not.
+ next unless $help{$cmd}{comment};
+
+ # Work through the comments line by line
+ foreach $line (split('\n', $help{$cmd}{comment})) {
+ # Leading whitespace or not?
+ if ($line =~ /^\s+\S+/) {
+ if (!$block) {
+ $block = 1 ;
+ print("<tscreen><verb>\n") ;
+ }
+ } else {
+ if ($block) {
+ $block = 0 ;
+ print("</verb></tscreen>\n") ;
+ }
+ }
+ print("$line\n") ;
+ }