#!/usr/bin/perl -w
-# Copyright © 2002, 2005 Jamie Zawinski <jwz@jwz.org>
+# Copyright © 2002-2014 Jamie Zawinski <jwz@jwz.org>
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
use Text::Wrap;
my $progname = $0; $progname =~ s@.*/@@g;
-my $version = q{ $Revision: 1.3 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
+my ($version) = ('$Revision: 1.7 $' =~ m/\s(\d[.\d]+)\s/s);
my $verbose = 0;
".BR X (1),\n" .
".BR xscreensaver (1)\n" .
".SH COPYRIGHT\n" .
- "Copyright \\(co 2002 by %AUTHOR%. " .
+ "Copyright \\(co %YEAR% by %AUTHOR%. " .
"Permission to use, copy, modify, \n" .
"distribute, and sell this software and its " .
"documentation for any purpose is \n" .
sub xml2man($) {
my ($exe) = @_;
+ $exe =~ s/\.xml$//s;
my $cfgdir = (-d "config" ? "config" : "../config");
my $xml = "$cfgdir/$exe.xml";
my $man = "$exe.man";
my $carg = $arg;
my $boolp = m/^<boolean/;
+ my $novalsp = 0;
if ($arg && $arg =~ m/^-no(-.*)/) {
$arg = "$1 | \\$arg";
$label = "Render in wireframe instead of solid.";
} elsif ($carg =~ m/^-delay/ && $hi && $hi >= 10000) {
$label = "Per-frame delay, in microseconds.";
- $def = sprintf ("%d (%0.2f seconds.)", $def, ($def/1000000.0));
+ $def = sprintf ("%d (%0.2f seconds)", $def, ($def/1000000.0));
$low = $hi = undef;
+ } elsif ($carg eq '-speed \fInumber\fP') {
+ $label = "Animation speed. 2.0 means twice as fast, " .
+ "0.5 means half as fast.";
+ $novalsp = 1;
} elsif ($boolp) {
$label .= ". Boolean.";
} elsif ($label) {
$args .= "[\\$carg]\n";
- $label .= " $low - $hi." if (defined($low) && defined($hi));
- $label .= " Default: $def." if (defined ($def));
+ if (! $novalsp) {
+ $label .= " $low - $hi." if (defined($low) && defined($hi));
+ $label .= " Default: $def." if (defined ($def));
+ }
$label = wrap ("", "", $label);
$body .= ".TP 8\n.B \\$arg\n$label";
} elsif (m@^<_description>\s*(.*)\s*</_description>@) {
$desc = $1;
+ } elsif (m@^<xscreensaver-updater@) {
+ } elsif (m@^<video\b@) {
} else {
print STDERR "$progname: ERROR: UNKNOWN: $_\n";
}
$author = "UNKNOWN";
}
+ $desc =~ s@http://en\.wikipedia\.org/[^\s]+@@gs;
+
$desc = wrap ("", "", $desc);
$body = (".TH XScreenSaver 1 \"\" \"X Version 11\"\n" .
$body .
$man_suffix);
+ my $year = $1 if ($author =~ s/; (\d{4})$//s);
+ $year = (localtime)[5] + 1900 unless $year;
+
$body =~ s/%AUTHOR%/$author/g;
+ $body =~ s/%YEAR%/$year/g;
#print $body; exit 0;