From da23ccc7059c553b77b9f1a43cd936860f9c4c19 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 15 Feb 2015 23:24:23 +0000 Subject: ($action): must be global so we can use it in the pod2usage call. (main) : 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 --- Master/texmf-dist/scripts/texlive/tlmgr.pl | 12 +++++++++--- 1 file 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); -- cgit v1.2.3