Skip to content

Commit

Permalink
Improved format-manpage.pl
Browse files Browse the repository at this point in the history
  • Loading branch information
mludvig committed Jan 6, 2012
1 parent cfcbb44 commit d9c7251
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions format-manpage.pl
Expand Up @@ -8,6 +8,7 @@

my $commands = "";
my $cfcommands = "";
my $wscommands = "";
my $options = "";

while (<>) {
Expand All @@ -20,6 +21,8 @@
$cmd = $1;
if ($cmd =~ /^cf/) {
$cfcommands .= ".TP\n$cmdline\n$desc\n";
} elsif ($cmd =~ /^ws/) {
$wscommands .= ".TP\n$cmdline\n$desc\n";
} else {
$commands .= ".TP\n$cmdline\n$desc\n";
}
Expand All @@ -29,18 +32,20 @@
my ($opt, $desc);
while (<>) {
last if (/^\s*$/);
$_ =~ s/\s*(.*?)\s*$/$1/;
$_ =~ s/(.*?)\s*$/$1/;
$desc = "";
$opt = "";
if (/^(-.*)/) {
if (/^ (-.*)/) {
$opt = $1;
if ($opt =~ / /) {
($opt, $desc) = split(/\s\s+/, $opt, 2);
}
$opt =~ s/(-[^ ,=]+)/\\fB$1\\fR/g;
$opt =~ s/(-[^ ,=\.]+)/\\fB$1\\fR/g;
$opt =~ s/-/\\-/g;
$options .= ".TP\n$opt\n";
} else {
$_ =~ s/\s*(.*?)\s*$/$1/;
$_ =~ s/(--[^ ,=\.]+)/\\fB$1\\fR/g;
$desc .= $_;
}
if ($desc) {
Expand Down Expand Up @@ -70,6 +75,10 @@
can do several \\fIactions\\fR specified by the following \\fIcommands\\fR.
$commands
.PP
Commands for static WebSites configuration
$wscommands
.PP
Commands for CloudFront management
$cfcommands
Expand Down Expand Up @@ -179,7 +188,7 @@
Report bugs to
.I s3tools\\-bugs\@lists.sourceforge.net
.SH COPYRIGHT
Copyright \\(co 2007,2008,2009,2010,2011 Michal Ludvig <http://www.logix.cz/michal>
Copyright \\(co 2007,2008,2009,2010,2011,2012 Michal Ludvig <http://www.logix.cz/michal>
.br
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License version 2 <http://www.gnu.org/licenses/gpl.html>.
Expand Down

0 comments on commit d9c7251

Please sign in to comment.