about summary refs log tree commit diff
path: root/generator
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2009-04-28 01:43:45 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2009-04-28 01:43:45 +0000
commitdbdc0476c3ed226ccba2750b09e25887ba12b2bb (patch)
treeb80cbcdbd9c08008b5b84125180f8a3e9c8a190e /generator
parent7258bf2ba30955d20dc0ba361df7c2de43704f5a (diff)
downloadnetpbm-mirror-dbdc0476c3ed226ccba2750b09e25887ba12b2bb.tar.gz
netpbm-mirror-dbdc0476c3ed226ccba2750b09e25887ba12b2bb.tar.xz
netpbm-mirror-dbdc0476c3ed226ccba2750b09e25887ba12b2bb.zip
Release 10.35.63
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@902 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'generator')
-rw-r--r--generator/ppmpat.c2
-rwxr-xr-xgenerator/ppmrainbow20
2 files changed, 15 insertions, 7 deletions
diff --git a/generator/ppmpat.c b/generator/ppmpat.c
index 343100d5..f4190d6c 100644
--- a/generator/ppmpat.c
+++ b/generator/ppmpat.c
@@ -919,7 +919,7 @@ main(int argc, char ** argv) {
 #define PAT_CAMO 7
 #define PAT_ANTICAMO 8
 #define PAT_TEST 9
-    const char* const usage = "-gingham|-g2|-gingham3|-g3|-madras|-tartan|-poles|-squig|-camo|-anticamo <width> <height>";
+    const char* const usage = "-gingham2|-g2|-gingham3|-g3|-madras|-tartan|-poles|-squig|-camo|-anticamo <width> <height>";
 
 
     ppm_init(&argc, argv);
diff --git a/generator/ppmrainbow b/generator/ppmrainbow
index 0effeecf..f98536cd 100755
--- a/generator/ppmrainbow
+++ b/generator/ppmrainbow
@@ -6,6 +6,13 @@ my ($FALSE, $TRUE) = (0,1);
 
 (my $myname = $0) =~ s#\A.*/##;
 
+sub fatal($) {
+    my ($msg) = @_;
+
+    print(STDERR "$msg\n");
+    exit(1);
+}
+
 my ($Twid, $Thgt, $tmpdir, $norepeat, $verbose);
 
 # set defaults
@@ -21,15 +28,16 @@ GetOptions("width=i"   => \$Twid,
            "norepeat!" => \$norepeat,
            "verbose!"  => \$verbose);
 
-die "invalid width and/or height\n" unless $Twid >= 1 && $Thgt >= 1;
-
+if ($Twid < 1 || $Thgt < 1) {
+    fatal("invalid width and/or height");
+}
 my $verboseCommand = $verbose ? "set -x;" : "";
 
 if (@ARGV < 1) {
-    die("You must specify at least one color as an argument");
+    fatal("You must specify at least one color as an argument");
 } elsif (@ARGV < 2 && $norepeat) {
-    die("With the -norepeat option, you must specify at least two colors " .
-        "as arguments.");
+    fatal("With the -norepeat option, you must specify at least two colors " .
+          "as arguments.");
 }
 
 my @colorlist;
@@ -57,7 +65,7 @@ while (@colorlist >= 2) {
     my $rc = system("$verboseCommand pgmramp -lr $w $Thgt | " .
                     "pgmtoppm \"$colorlist[0]-$colorlist[1]\" >$outfile");
     if ($rc != 0) {
-        die("pgmramp|pgmtoppm failed.");
+        fatal("pgmramp|pgmtoppm failed.");
     }
     $widthRemaining -= $w;
     $n++;