summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-01-04 12:50:55 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2010-01-04 12:50:55 +0100
commit55acc72208aa27aed7f848a59084d5767ffe6857 (patch)
treecb14c6403cc16b1119e529d539b25efe67ff5e03 /bin
parenta7eca51b8e19d68790cae86a93bd95f45c176b92 (diff)
Simplify --exclude parsing
Diffstat (limited to 'bin')
-rwxr-xr-xbin/efa25
1 files changed, 9 insertions, 16 deletions
diff --git a/bin/efa b/bin/efa
index 0d4cdfa..694b6b2 100755
--- a/bin/efa
+++ b/bin/efa
@@ -290,22 +290,15 @@ if ($date) {
}
if (@exclude) {
- foreach (@exclude) {
- given ($_) {
- when ('zug') { $post{inclMOT_0} = undef }
- when ('s-bahn') { $post{inclMOT_1} = undef }
- when ('u-bahn') { $post{inclMOT_2} = undef }
- when ('stadtbahn') { $post{inclMOT_3} = undef }
- when ('tram') { $post{inclMOT_4} = undef }
- when ('stadtbus') { $post{inclMOT_5} = undef }
- when ('regionalbus') { $post{inclMOT_6} = undef }
- when ('schnellbus') { $post{inclMOT_7} = undef }
- when ('seilbahn') { $post{inclMOT_8} = undef }
- when ('schiff') { $post{inclMOT_9} = undef }
- when ('ast') { $post{inclMOT_10} = undef }
- when ('sonstige') {$post{inclMOT_11} = undef }
- default {
- print STDERR "--exclude: invalid argument '$_'\n";
+ my @mapping = qw/
+ zug s-bahn u-bahn stadtbahn tram stadtbus regionalbus
+ schnellbus seilbahn schiff ast sonstige
+ /;
+
+ foreach my $exclude_type (@exclude) {
+ for my $map_id (0 .. $#mapping) {
+ if ($exclude_type eq $mapping[$map_id]) {
+ $post{"inclMOT_$map_id"} = undef;
}
}
}