63 lines
2.0 KiB
Diff
63 lines
2.0 KiB
Diff
diff -urNp a/editor/ppmfade b/editor/ppmfade
|
|
--- a/editor/ppmfade 2025-02-04 10:47:27.812451607 +0100
|
|
+++ b/editor/ppmfade 2025-02-04 10:52:14.233336029 +0100
|
|
@@ -99,6 +99,9 @@ sub commandLineArgs() {
|
|
$mode = 'BLOCK';
|
|
} elsif ($arg eq "-mix") {
|
|
$mode = 'MIX';
|
|
+ } elsif ($arg eq "-help" || $arg eq "--help" || $arg eq "-h") {
|
|
+ print STDERR ("ppmfade: Use 'man ppmfade' for help.\n");
|
|
+ exit 1;
|
|
} else {
|
|
if (substr($arg, 0, 1) eq '-') {
|
|
print STDERR ("Unknown option '$arg'. " .
|
|
@@ -109,13 +112,13 @@ sub commandLineArgs() {
|
|
print STDERR ("There are no non-option arguments possible. " .
|
|
"You specified '$arg'\n");
|
|
}
|
|
- exit 100;
|
|
+ exit 1;
|
|
}
|
|
}
|
|
|
|
if (!defined($firstFileNm) && !defined($lastFileNm)) {
|
|
print STDERR ("You must specify -f or -l (or both)\n");
|
|
- exit 90;
|
|
+ exit 1
|
|
}
|
|
|
|
if (!defined($mode)) {
|
|
@@ -142,7 +145,7 @@ sub imageDimensions($$) {
|
|
} else {
|
|
print STDERR
|
|
("Unrecognized results from pnmfile on $firstFileNm.\n");
|
|
- exit(50);
|
|
+ exit(1);
|
|
}
|
|
} else {
|
|
# $lastFileNm is defined
|
|
@@ -151,7 +154,7 @@ sub imageDimensions($$) {
|
|
} else {
|
|
print STDERR
|
|
("Unrecognized results from pnmfile on $firstFileNm.\n");
|
|
- exit(50);
|
|
+ exit(1);
|
|
}
|
|
}
|
|
return $width, $height;
|
|
@@ -436,12 +439,12 @@ my ($mode, $firstFileNm, $lastFileNm, $b
|
|
|
|
if (defined($firstFileNm) && !-e($firstFileNm)) {
|
|
print STDERR ("First file '$firstFileNm' does not exist\n");
|
|
- exit 20;
|
|
+ exit 1;
|
|
}
|
|
|
|
if (defined($lastFileNm) && !-e($lastFileNm)) {
|
|
print STDERR ("Last file '$lastFileNm' does not exist\n");
|
|
- exit 20;
|
|
+ exit 1;
|
|
}
|
|
|
|
my ($width, $height) = imageDimensions($firstFileNm, $lastFileNm);
|