From e587297a62ebc4e3e4d954ddd11d4c6a7a3af52a Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Fri, 1 Mar 2002 14:08:03 +0000 Subject: [PATCH] * gindex.pl: Add optional 4th argument for translated Content section name. --- src/ChangeLog | 5 +++++ src/gindex.pl | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 65d98bfdc..d0e354d55 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-03-01 Andrew V. Samoilov + + * gindex.pl: Add optional 4th argument for translated + Content section name. + 2002-02-28 Andrew V. Samoilov * mad.c: Make mem_areas dynamically growing. diff --git a/src/gindex.pl b/src/gindex.pl index 6388bbbe7..6cad4ccca 100755 --- a/src/gindex.pl +++ b/src/gindex.pl @@ -3,8 +3,12 @@ # the warranty are quite big, we leave them at the end of the help file, # the index will be consulted quite frequently, so we put it at the beginning. -if ($#ARGV != 2) { - die "Three arguments required"; +if ($#ARGV == 3) { + $Topics = "$ARGV[3]"; +} elsif ($#ARGV == 2) { + $Topics = 'Topics:'; +} else { + die "Usage: gindex.pl man_file tmpl_file out_file [Topic section header]"; } $man_file = "$ARGV[0]"; @@ -47,11 +51,11 @@ if (-e "$out_file") { open (OUTPUT, "> $out_file") or die "Cannot open $out_file: $!\n"; -print OUTPUT "\x04[Contents]\nTopics:\n\n"; +print OUTPUT "\x04[Contents]\n$Topics\n\n"; foreach $node (@nodes){ if (length $node){ $node =~ m/^( *)(.*)\x02(.*)$/; - printf OUTPUT (" %s\x01 %s \x02%s\x03", $1, $3, $2); + print OUTPUT (" $1\x01 $3 \x02$2\x03"); } print OUTPUT "\n"; }