summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr2.pl60
1 files changed, 41 insertions, 19 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr2.pl b/Master/texmf/scripts/texlive/tlmgr2.pl
index 02266898dfa..2f1759ef9e2 100755
--- a/Master/texmf/scripts/texlive/tlmgr2.pl
+++ b/Master/texmf/scripts/texlive/tlmgr2.pl
@@ -707,10 +707,10 @@ sub action_remove {
# ARGV can look like:
# paper a4
# paper letter
-# [xdvi|dvips|pdftex|dvipdfm|dvipdfmx|context] paper [help|papersize|--list]
+# [xdvi|...|context] paper [help|papersize|--list]
#
sub action_paper {
- my %ret;
+ my %ret = ();
action_gui("config") if $opts{"gui"};
tlwarn("machine-readable output not supported for paper\n")
if $::machinereadble;
@@ -720,15 +720,26 @@ sub action_paper {
$ENV{"TEXMFCONFIG"} = $texmfsysconfig;
my $action = shift @ARGV;
- if ($action =~ m/^paper$/i) {
+ if ($action =~ m/^paper$/i) { # generic paper
my $newpaper = shift @ARGV;
- if (!defined($newpaper) || $newpaper !~ /^(a4|letter)$/) {
- $newpaper = "the empty string." if !defined($newpaper);
- tlwarn("tlmgr: paper expects `a4' or `letter', not $newpaper.\n");
- return;
+ if ($opts{"list"}) { # tlmgr paper --list => complain.
+ tlwarn("tlmgr: ignoring paper setting to $newpaper with --list\n")
+ if $newpaper; # complain if they tried to set, too.
+ tlwarn("tlmgr: please specify a program before paper --list, ",
+ "as in: tlmgr pdftex paper --list\n");
+
+ } elsif (!defined($newpaper)) { # tlmgr paper => show all current sizes.
+ TeXLive::TLPaper::paper_all($texmfsysconfig,undef);
+
+ } elsif ($newpaper !~ /^(a4|letter)$/) { # tlmgr paper junk => complain.
+ $newpaper = "the empty string" if !defined($newpaper);
+ tlwarn("tlmgr: expected `a4' or `letter' after paper, not $newpaper\n");
+
+ } else { # tlmgr paper {a4|letter} => do it.
+ merge_into(\%ret,TeXLive::TLPaper::paper_all($texmfsysconfig,$newpaper));
}
- merge_into(\%ret, TeXLive::TLPaper::paper_all($texmfsysconfig, $newpaper));
- } else {
+
+ } else { # program-specific paper
my $prog = $action; # first argument is the program to change
my $arg = shift @ARGV; # get "paper" argument
if (!defined($arg) || $arg ne "paper") {
@@ -736,8 +747,8 @@ sub action_paper {
tlwarn("tlmgr: expected `paper' after $prog, not $arg\n");
return;
}
- # the do_paper progs check for the arguments --list, so if given
- # put it back on the cmd line
+ # the do_paper progs check for the argument --list, so if given
+ # restore it to the cmd line.
unshift(@ARGV, "--list") if $opts{"list"};
merge_into(\%ret, TeXLive::TLPaper::do_paper($prog,$texmfsysconfig,@ARGV));
}
@@ -3068,18 +3079,29 @@ directories specified by the respective options (see above).
=over 4
-=item B<paper a4>
+=item B<paper [a4|letter]>
-=item B<paper letter>
-
-=item B<[xdvi|pdftex|dvips|dvipdfmx|dvipdfm|context] paper [help|I<papersize>|--list]>
+=item B<S<[xdvi|pdftex|dvips|dvipdfmx|dvipdfm|context] paper [I<papersize>|--list]>>
=back
-Configures the system wide paper settings, either for all programs at
-once (first two forms), or just for the specified program (third
-form). The third form with C<--list> outputs all known papersizes for the
-specified program.
+With no arguments (C<tlmgr paper>), shows the default paper size setting
+for all known programs.
+
+With one argument (e.g., C<tlmgr paper a4>), sets the default for all
+known programs to that paper size.
+
+With a program given as the first argument and no paper size specified
+(e.g., C<tlmgr dvips paper>), shows the default paper size for that
+program.
+
+With a program given as the first argument and a paper size as the last
+argument (e.g., C<tlmgr dvips paper a4>), set the default for that
+program to that paper size.
+
+With a program given as the first argument and C<--list> given as the
+last argument (e.g., C<tlmgr dvips paper --list>), shows all valid paper
+sizes for that program. The first size shown is the default.
=head2 arch list|add I<arch>...