summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-10-20 21:58:53 +0000
committerKarl Berry <karl@freefriends.org>2016-10-20 21:58:53 +0000
commitff4d0504ea200ee5fe3f4956b00570f6c2ca0a39 (patch)
treeebe7eccf2f2413c8bce4a8cf97e8631c1ea9f7fb
parenta2f40ca4b8755633c5943ed2accbdc6261f8bdc1 (diff)
pdflatexpicscale (20oct16)
git-svn-id: svn://tug.org/texlive/trunk@42313 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/pdflatexpicscale/pdflatexpicscale.pl36
-rw-r--r--Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.pdfbin187176 -> 187722 bytes
-rw-r--r--Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.tex5
-rwxr-xr-xMaster/texmf-dist/scripts/pdflatexpicscale/pdflatexpicscale.pl36
4 files changed, 57 insertions, 20 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/pdflatexpicscale/pdflatexpicscale.pl b/Build/source/texk/texlive/linked_scripts/pdflatexpicscale/pdflatexpicscale.pl
index 5e236e4f9b5..b37516de7e8 100755
--- a/Build/source/texk/texlive/linked_scripts/pdflatexpicscale/pdflatexpicscale.pl
+++ b/Build/source/texk/texlive/linked_scripts/pdflatexpicscale/pdflatexpicscale.pl
@@ -7,17 +7,21 @@
# 2016-07-27 first public release
# 2016-08-02 changed regex to prevent problem with long filenames
# 2016-08-02 changed > to gt (shame on me)
+# 2016-10-20 corrected behaviour when program gets called without arguments
+# (shame on me, again)
+# 2016-10-20 added undocumented switch --help to show usage.
use strict;
use File::Basename;
use File::Spec;
use File::Copy;
use Getopt::Long;
-my $version = '0.2';
-my $versiondate = '2016-08-02';
+my $version = '0.3';
+my $versiondate = '2016-10-20';
my $showversion;
my $verbose;
+my $help;
my $TeXproject;
# folders for scaled graphics, relative names
@@ -169,6 +173,10 @@ sub readlog
unless (/\sused/){
chomp $buffer;
$buffer .= <LOGFILE>;
+ } # twice ought to be enough
+ unless (/\sused/){
+ chomp $buffer;
+ $buffer .= <LOGFILE>;
}
if($buffer =~ /Info:\s(\S*)\.(\w+)\sused/){
$picname = $1;
@@ -215,21 +223,29 @@ GetOptions('verbose' => \$verbose,
'destdir=s' => \$printfolderprefix,
'tolerance=i' => \$tolerance,
'srcdir=s' => \$srcfolder,
- 'version' => \$showversion);
+ 'version' => \$showversion,
+ 'help' => \$help,
+ 'usage' => \$help,
+ );
-$TeXproject = shift;
if($showversion){
print "pdflatexpicscale Version $version $versiondate\n";
}
-unless ($TeXproject gt ' '){
+if($help){
usage();
- end();
}
-readlog($TeXproject);
-if($verbose) {
- print "$copied file(s) copied, $scaled file(s) converted " .
- "and $skipped occurence(s) skipped.\n";
+$TeXproject = shift;
+
+if((defined $TeXproject) && ($TeXproject gt ' ')){
+ readlog($TeXproject);
+ if($verbose) {
+ print "pdflatexpicscale Version $version:\n"
+ . "$copied file(s) copied, $scaled file(s) converted " .
+ "and $skipped occurence(s) skipped for:\n${TeXproject}.log.\n";
+ }
+}else {
+ usage();
}
diff --git a/Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.pdf b/Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.pdf
index 82088d1f6b6..2719a546c7a 100644
--- a/Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.pdf
+++ b/Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.tex b/Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.tex
index ad3a452f21c..ce15238676b 100644
--- a/Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.tex
+++ b/Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.tex
@@ -283,4 +283,9 @@ information about anisotropic scaling and clipping
\paragraph{2016-08-02} Fixed some typos. Corrected handling of lines wrapped
in the log file.
+
+\paragraph{2016-10-20} Removed a nagging error message when the program was
+called without arguments. Added the argument \texttt{--help}, both due to
+suggestions by Karl Berry (thanks a lot).
+
\end{document}
diff --git a/Master/texmf-dist/scripts/pdflatexpicscale/pdflatexpicscale.pl b/Master/texmf-dist/scripts/pdflatexpicscale/pdflatexpicscale.pl
index 5e236e4f9b5..b37516de7e8 100755
--- a/Master/texmf-dist/scripts/pdflatexpicscale/pdflatexpicscale.pl
+++ b/Master/texmf-dist/scripts/pdflatexpicscale/pdflatexpicscale.pl
@@ -7,17 +7,21 @@
# 2016-07-27 first public release
# 2016-08-02 changed regex to prevent problem with long filenames
# 2016-08-02 changed > to gt (shame on me)
+# 2016-10-20 corrected behaviour when program gets called without arguments
+# (shame on me, again)
+# 2016-10-20 added undocumented switch --help to show usage.
use strict;
use File::Basename;
use File::Spec;
use File::Copy;
use Getopt::Long;
-my $version = '0.2';
-my $versiondate = '2016-08-02';
+my $version = '0.3';
+my $versiondate = '2016-10-20';
my $showversion;
my $verbose;
+my $help;
my $TeXproject;
# folders for scaled graphics, relative names
@@ -169,6 +173,10 @@ sub readlog
unless (/\sused/){
chomp $buffer;
$buffer .= <LOGFILE>;
+ } # twice ought to be enough
+ unless (/\sused/){
+ chomp $buffer;
+ $buffer .= <LOGFILE>;
}
if($buffer =~ /Info:\s(\S*)\.(\w+)\sused/){
$picname = $1;
@@ -215,21 +223,29 @@ GetOptions('verbose' => \$verbose,
'destdir=s' => \$printfolderprefix,
'tolerance=i' => \$tolerance,
'srcdir=s' => \$srcfolder,
- 'version' => \$showversion);
+ 'version' => \$showversion,
+ 'help' => \$help,
+ 'usage' => \$help,
+ );
-$TeXproject = shift;
if($showversion){
print "pdflatexpicscale Version $version $versiondate\n";
}
-unless ($TeXproject gt ' '){
+if($help){
usage();
- end();
}
-readlog($TeXproject);
-if($verbose) {
- print "$copied file(s) copied, $scaled file(s) converted " .
- "and $skipped occurence(s) skipped.\n";
+$TeXproject = shift;
+
+if((defined $TeXproject) && ($TeXproject gt ' ')){
+ readlog($TeXproject);
+ if($verbose) {
+ print "pdflatexpicscale Version $version:\n"
+ . "$copied file(s) copied, $scaled file(s) converted " .
+ "and $skipped occurence(s) skipped for:\n${TeXproject}.log.\n";
+ }
+}else {
+ usage();
}