summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-02-15 23:24:23 +0000
committerKarl Berry <karl@freefriends.org>2015-02-15 23:24:23 +0000
commitda23ccc7059c553b77b9f1a43cd936860f9c4c19 (patch)
tree1f9d89a59368c3428b57312564ab783b9966709e /Master
parent401c80838a830b62c19b6b4edd264cd761fe4b93 (diff)
($action): must be global so we can use it in the
pod2usage call. (main) <help>: call pod2usage using list form, so sections/subsections are interpreted as desired. git-svn-id: svn://tug.org/texlive/trunk@36286 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl12
1 files changed, 9 insertions, 3 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 1ccba6027d6..7d677000c51 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -25,6 +25,7 @@ our $packagelogfile;
our $packagelogged;
our $tlmgr_config_file;
our $pinfile;
+our $action; # for the pod2usage -sections call
BEGIN {
$^W = 1;
@@ -150,7 +151,7 @@ sub main {
"backupdir" => "=s",
"clean" => ":-99",
"dry-run|n" => 1 },
- "candidate" => { },
+ "candidates" => { },
"check" => { "use-svn" => 1 },
"conf" => { "conffile" => "=s",
"delete" => 1 },
@@ -243,7 +244,7 @@ sub main {
$::machinereadable = $opts{"machine-readable"}
if (defined($opts{"machine-readable"}));
- my $action = shift @ARGV;
+ $action = shift @ARGV;
if (!defined($action)) {
if ($opts{"gui"}) { # -gui = gui
$action = "gui";
@@ -320,8 +321,13 @@ sub main {
delete $ENV{'LESSPIPE'};
delete $ENV{'LESSOPEN'};
if ($action && ($action ne "help")) {
+ # 1) Must use [...] form for -sections arg because otherwise the
+ # /$action subsection selector applies to all sections.
+ # https://rt.cpan.org/Public/Bug/Display.html?id=102116
+ # 2) Must use "..." for that so the $action value is interpolated.
pod2usage(-exitstatus => 0, -verbose => 99,
- -sections => "NAME|SYNOPSIS|ACTIONS/$action.*" , @noperldoc);
+ -sections => [ 'NAME', 'SYNOPSIS', "ACTIONS/$::action.*" ],
+ @noperldoc);
} else {
if ($opts{"help"}) {
pod2usage(-exitstatus => 0, -verbose => 2, @noperldoc);