Ethereal-dev: Re: [Ethereal-dev] ethereal man page

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Carlos Pignataro <cpignata@xxxxxxxxx>
Date: Tue, 25 May 2004 16:17:27 -0400
At 10:47 AM 5/25/2004 -0700, Guy Harris wrote:
>On Tue, May 25, 2004 at 08:57:58AM -0400, Carlos Pignataro wrote:
>> There's 2 small issues with ethereal man page:
>> 
>> 1. Since now ethereal.1 is made from pod2man $(srcdir)/ethereal-tmp.pod, the man title
>>    now displays "ETHEREAL-TMP 1" instead of "ETHEREAL 1":
>> 
>> man ethereal | head
>> ETHEREAL-TMP(1)          The Ethereal Network Analyzer         ETHEREAL-TMP(1)
>
>We might want to rename "ethereal.pod" back to to "ethereal.pod.in" and
>generate "ethereal.pod" from it and from AUTHORS-SHORT.
>
>> 2. Since make-authors-short.pl is making AUTHORS-SHORT with all lines starting without
>>    space or tab, pod is treating the paragraphs as `Ordinary Paragraph' instead of 
>>    `Verbatim Paragraph' [check man perlpod] and misaligning:
>
>        ...
>
>> The following patch fixes #2 by prepending a space into all non empty lines.
>
>Unfortunately, that appears to cause *all* the stuff from the AUTHORS
>file to be turned into verbatim text, including the paragraphs after the
>list of authors.

Guy,

Something like this would make it like it was in doc/ethereal.pod, that is not prepend the spaces after the list of authors.

Index: make-authors-short.pl
===================================================================
RCS file: /cvsroot/ethereal/make-authors-short.pl,v
retrieving revision 1.3
diff -u -r1.3 make-authors-short.pl
--- make-authors-short.pl       22 May 2004 14:05:33 -0000      1.3
+++ make-authors-short.pl       25 May 2004 20:10:03 -0000
@@ -9,19 +9,21 @@

 my $subinfo=0;
 my $nextline;
+my $prepend = "  ";

 while (<>) {
        if (/(.*){/) {
                $subinfo = 1;
-               print "$1\n";
+               print "$prepend$1\n";
        } elsif (/}/) {
                $subinfo = 0;
                if (($nextline = <>) !~ /^[\s\r]*$/) {
-                       print $nextline;
+                       print "$prepend$nextline";
                }
        } elsif ($subinfo == 1) {
                next;
        } else {
-               print;
+               if (/was kind enough to/) {$prepend = "";}
+               printf "%s%s", ($_ =~ /^[\s\r]*$/) ? "" : $prepend, $
        }
 }


Or maybe even something like this would do:

#!/usr/bin/perl -w

# $Id: make-authors-short.pl,v 1.3 2004/05/22 14:05:33 jmayer Exp $

# Remove tasks from individual author entries from AUTHORS file
# for use in the about dialog.

use strict;
undef $/;

my $prepend = "  ";
my $authors = <>;
$authors =~ s/{.*?}[\s\r]//gs;

foreach (split ("\n", $authors)){
        if (/was kind enough to/) {$prepend = "";}
        print "$prepend$_\n";
}
exit;


>It also means that every line in AUTHORS-SHORT begins with a space; that
>causes a space before every line in the "Authors" page of the "About"
>dialog if Ethereal is built with GTK+ 1.3[.x] or 2.x.  That might be OK,
>but....

$prepend could be changed to `$prepend = shift;' and call the script with the string_to_prepend parameter, either "  " or "".

Regards,


--Carlos.
Escalation RTP - Cisco Systems