From 5a68f84799ebc8078d3102a1c6fee44dcc07d959 Mon Sep 17 00:00:00 2001 From: bp-sawyers Date: Fri, 2 Nov 2012 16:23:14 +0000 Subject: [PATCH] Fix rmkit man page git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14233 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/pods/man1/rmkit.1.pod | 11 +++-------- xCAT-client/xpod2man | 6 ++---- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/xCAT-client/pods/man1/rmkit.1.pod b/xCAT-client/pods/man1/rmkit.1.pod index 3a61a896b..c017baae5 100644 --- a/xCAT-client/pods/man1/rmkit.1.pod +++ b/xCAT-client/pods/man1/rmkit.1.pod @@ -1,17 +1,12 @@ =head1 NAME -Usage: - rmkit [-h|--help] - rmkit [-f|--force] [-V|--verbose] ] - - -B - Remove Kits from xCAT +B - Remove Kits from xCAT =head1 SYNOPSIS -B [-h|--help] +B [-h|--help] -B [-V|--verbose] [-f|--force] +B [-V|--verbose] [-f|--force] =head1 DESCRIPTION diff --git a/xCAT-client/xpod2man b/xCAT-client/xpod2man index d4c2399af..57ae6b832 100755 --- a/xCAT-client/xpod2man +++ b/xCAT-client/xpod2man @@ -163,17 +163,15 @@ EOS1 # extract the summary for each cmd from its man page foreach my $manpage (@_) { - my ($sectionnum) = $manpage =~ /\.(\d+)\.pod$/; + my ($cmd, $sectionnum) = $manpage =~ /([^\/]+)\.(\d+)\.pod$/; # Suck in the whole file, then we will parse it. open(MANPAGE, "$manpage") or die "Error: could not open $manpage for reading.\n"; my @contents = ; my $wholemanpage = join('', @contents); close(MANPAGE); # This regex matches: optional space, =head1, space, title, space, cmd, space, description, newline - my ($cmd, $description) = $wholemanpage =~ /^\s*=head1\s+\S+\s+(\S+)\s+(.+?)\n/si; - if (!defined($cmd)) { print "Warning: $manpage is not in a recognized structure. It will be ignored.\n"; next; } + my ($description) = $wholemanpage =~ /^\s*=head1\s+\S+\s+\S+\s+(.+?)\n/si; if (!defined($description)) { print "Warning: $manpage does not have a description for $cmd. It will be ignored.\n"; next; } - $cmd =~ s/^.<(.+)>$/$1/; # if the cmd name has pod formatting around it, strip it off $description =~ s/^-\s*//; # if the description has a leading hypen, strip it off print FILE "\n=item L<$cmd($sectionnum)|$cmd.$sectionnum>\n\n".$description."\n"; }