summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts
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 /Master/texmf-dist/scripts
parenta2f40ca4b8755633c5943ed2accbdc6261f8bdc1 (diff)
pdflatexpicscale (20oct16)
git-svn-id: svn://tug.org/texlive/trunk@42313 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rwxr-xr-xMaster/texmf-dist/scripts/pdflatexpicscale/pdflatexpicscale.pl36
1 files changed, 26 insertions, 10 deletions
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();
}