Bug fixes to the doc generating scripts

Correct the author output in doc-insmod.pl
        Handle unknown prefix with suggestion in doc-features.pl


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1581 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2002-11-07 12:43:28 +00:00
1 parent 67ad2ab008
commit 74db33831d
3 files changed
+38 -11

No files matched your search

+21 -1
View File
@@ -324,7 +324,27 @@ if (@ARGV)
my %rprefix = reverse %prefix;
foreach my $prefix (@ARGV)
{
output_data($rprefix{$prefix});
if (exists $rprefix{$prefix})
{
output_data($rprefix{$prefix})
}
else
{
my $lines = 0;
print "No chip named `$prefix' was found.\n",
"Suggestions:\n";
foreach my $k (sort keys %rprefix)
{
if (grep /$prefix/, $k)
{
print " $k\n";
$lines++;
}
}
print " (none)\n"
unless $lines;
print "\n";
}
}
}
else
+5 -1
View File
@@ -54,7 +54,7 @@ sub print_modinfo
my ($author, $license);
$author = `$modinfo -a $modname`;
$author =~ s/\n\s*/ /mg;
$author =~ s/\n\s+/ /mg; # handle multiline authors
$author =~ s/^"//;
$author =~ s/"$//;
if (defined $version and $version >= (2<<16)+(4<<8)+15)
@@ -69,14 +69,18 @@ sub print_modinfo
if defined $license;
print "\n", "Module Parameters\n", "-----------------\n", "\n";
my $lines = 0;
open OPTIONS, "$modinfo -p $modname |";
while (<OPTIONS>)
{
next unless m/^(parm:\s*)?(\S+) (.+), description "(.*)"$/;
print "* $2: $3\n",
wrap(' ', ' ', $4), "\n";
$lines++;
}
close OPTIONS;
print "(none)\n"
unless $lines;
}
if (@ARGV != 1 or $ARGV[0] =~ /^-/)