summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-01-04 13:22:33 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2010-01-04 13:22:33 +0100
commit2b323231694bd13a023444227f194ea71e064a59 (patch)
tree59526f713ebdc08b22902d86212dce63d407af10
parent55acc72208aa27aed7f848a59084d5767ffe6857 (diff)
Improve an error message, use die/warn instead of print STDERR
-rwxr-xr-xbin/efa11
1 files changed, 5 insertions, 6 deletions
diff --git a/bin/efa b/bin/efa
index 694b6b2..fa3a14f 100755
--- a/bin/efa
+++ b/bin/efa
@@ -237,8 +237,7 @@ if (not (@from and @to)) {
}
if (@to != 2 or @from != 2) {
- print STDERR "Usage: see '$0 --help'\n";
- exit 1;
+ die("Insufficient to/from arguments, see $0 --help for usage\n");
}
for my $pair (
@@ -264,7 +263,7 @@ if (@via == 2) {
foreach my $type ($from_type, $to_type, $via_type) {
if (not ($type ~~ ['stop', 'address', 'poi'])) {
$type = 'stop';
- print STDERR "from/to/via type: must be stop, address or poi\n";
+ warn("from/to/via type: Must be stop, address or poi, not '$type'\n");
}
}
@@ -314,7 +313,7 @@ if ($prefer) {
when ('nowait') { $post{routeType} = 'LEASTINTERCHANGE' }
when ('nowalk') { $post{routeType} = 'LEASTWALKING' }
default {
- print STDERR "--prefer usage: speed / nowait / nowalk\n";
+ warn("--prefer usage: speed / nowait / nowalk\n");
}
}
}
@@ -330,7 +329,7 @@ if ($include) {
when ('ice') { $post{lineRestriction} = 400 }
when (/\d+/) { $post{lineRestriction} = $include }
default {
- print STDERR "--include usage: local / ic / ice\n";
+ warn("--include usage: local / ic / ice\n");
}
}
}
@@ -340,7 +339,7 @@ if ($walk_speed) {
$post{changeSpeed} = $walk_speed;
}
else {
- print STDERR "--walk-speed usage: normal / fast / slow\n";
+ warn("--walk-speed usage: normal / fast / slow\n");
}
}