summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLPaper.pm
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2017-11-13 17:05:14 +0000
committerNorbert Preining <preining@logic.at>2017-11-13 17:05:14 +0000
commit3b7fca8248b6f2f73cb9d1dd6011c29fbc3b9f55 (patch)
tree95fbc2229db732cc2c41534fec180c347b4840b6 /Master/tlpkg/TeXLive/TLPaper.pm
parent86830c3b1728a5ad4d946bc32b722762a9010439 (diff)
tlmgr paper --json output
git-svn-id: svn://tug.org/texlive/trunk@45776 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLPaper.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLPaper.pm39
1 files changed, 39 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLPaper.pm b/Master/tlpkg/TeXLive/TLPaper.pm
index 8f2f469aac1..70bd55ef501 100644
--- a/Master/tlpkg/TeXLive/TLPaper.pm
+++ b/Master/tlpkg/TeXLive/TLPaper.pm
@@ -396,6 +396,17 @@ sub paper_pdftex {
for my $p (keys %pdftex_papersize) {
info("$p\n") unless ($p eq $currentpaper);
}
+ } elsif ($newpaper eq "--json") {
+ my @ret = ();
+ push @ret, "$currentpaper";
+ for my $p (keys %pdftex_papersize) {
+ push @ret, $p unless ($p eq $currentpaper);
+ }
+ my %foo;
+ $foo{'program'} = "pdftex";
+ $foo{'file'} = $inp;
+ $foo{'options'} = \@ret;
+ return \%foo;
} elsif ($newpaper eq "--returnlist") {
my @ret = ();
push @ret, "$currentpaper";
@@ -542,6 +553,12 @@ sub paper_dvips {
for my $p (@papersizes) {
info("$p\n"); # first is already the selected one
}
+ } elsif ($newpaper eq "--json") {
+ my %foo;
+ $foo{'program'} = "dvips";
+ $foo{'file'} = $inp;
+ $foo{'options'} = \@papersizes;
+ return \%foo;
} elsif ($newpaper eq "--returnlist") {
return(\@papersizes);
} else {
@@ -703,6 +720,17 @@ sub paper_context {
for my $p (keys %pdftex_papersize) {
info("$p\n") unless ($p eq $currentpaper);
}
+ } elsif ($newpaper eq "--json") {
+ my @ret = ();
+ push @ret, "$currentpaper";
+ for my $p (keys %pdftex_papersize) {
+ push @ret, $p unless ($p eq $currentpaper);
+ }
+ my %foo;
+ $foo{'program'} = "context";
+ $foo{'file'} = $inp;
+ $foo{'options'} = \@ret;
+ return \%foo;
} elsif ($newpaper eq "--returnlist") {
my @ret = ();
push @ret, "$currentpaper";
@@ -862,6 +890,17 @@ sub paper_do_simple {
for my $p (@$paplist) {
info("$p\n") unless ($p eq $currentpaper);
}
+ } elsif ($newpaper eq "--json") {
+ my @ret = ();
+ push @ret, "$currentpaper";
+ for my $p (@$paplist) {
+ push @ret, $p unless ($p eq $currentpaper);
+ }
+ my %foo;
+ $foo{'program'} = $prog;
+ $foo{'file'} = $inp;
+ $foo{'options'} = \@ret;
+ return \%foo;
} elsif ($newpaper eq "--returnlist") {
my @ret = ();
push @ret, $currentpaper;