Better error messages.

This commit is contained in:
Dianne Skoll
2022-01-27 21:41:12 -05:00
parent ae90243352
commit db624d8a8a
2 changed files with 6 additions and 3 deletions

View File

@@ -102,10 +102,13 @@ if ($settings->{landscape}) {
$settings->{height} = $tmp;
}
my $me = $0;
$me =~ s/^.*\///;
# Don't read from a terminal
if (-t STDIN) {
print STDERR "I can't read data from a terminal. Please run like this:\n";
print STDERR " remind -pp [options] filename | $0 [options] > out.pdf\n";
print STDERR " remind -pp [options] filename | $me [options] > out.pdf\n";
exit(1);
}
@@ -135,7 +138,7 @@ while(1) {
if (!$obj) {
if (!$done_one) {
$errored_out = 1;
print STDERR "$err\n";
print STDERR "$me: $err\n";
exit(1);
}
last;

View File

@@ -100,7 +100,7 @@ sub read_one_month
# Old-style "remind -p"
# TODO: Eventually support this?
return (undef, "Format not supported: Use -pp or -ppp, not plain -p");
return (undef, "Format not supported: Use 'remind -pp', not plain -p");
}
sub read_one_month_pp