texlive[42313] trunk: pdflatexpicscale (20oct16)
commits+karl at tug.org
commits+karl at tug.org
Thu Oct 20 23:58:53 CEST 2016
Revision: 42313
http://tug.org/svn/texlive?view=revision&revision=42313
Author: karl
Date: 2016-10-20 23:58:53 +0200 (Thu, 20 Oct 2016)
Log Message:
-----------
pdflatexpicscale (20oct16)
Modified Paths:
--------------
trunk/Build/source/texk/texlive/linked_scripts/pdflatexpicscale/pdflatexpicscale.pl
trunk/Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.pdf
trunk/Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.tex
trunk/Master/texmf-dist/scripts/pdflatexpicscale/pdflatexpicscale.pl
Modified: trunk/Build/source/texk/texlive/linked_scripts/pdflatexpicscale/pdflatexpicscale.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/pdflatexpicscale/pdflatexpicscale.pl 2016-10-20 21:58:37 UTC (rev 42312)
+++ trunk/Build/source/texk/texlive/linked_scripts/pdflatexpicscale/pdflatexpicscale.pl 2016-10-20 21:58:53 UTC (rev 42313)
@@ -7,6 +7,9 @@
# 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;
@@ -13,11 +16,12 @@
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 @@
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 @@
'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();
}
Modified: trunk/Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.tex 2016-10-20 21:58:37 UTC (rev 42312)
+++ trunk/Master/texmf-dist/doc/support/pdflatexpicscale/pdflatexpicscale.tex 2016-10-20 21:58:53 UTC (rev 42313)
@@ -283,4 +283,9 @@
\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}
Modified: trunk/Master/texmf-dist/scripts/pdflatexpicscale/pdflatexpicscale.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/pdflatexpicscale/pdflatexpicscale.pl 2016-10-20 21:58:37 UTC (rev 42312)
+++ trunk/Master/texmf-dist/scripts/pdflatexpicscale/pdflatexpicscale.pl 2016-10-20 21:58:53 UTC (rev 42313)
@@ -7,6 +7,9 @@
# 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;
@@ -13,11 +16,12 @@
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 @@
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 @@
'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();
}
More information about the tex-live-commits
mailing list