summaryrefslogtreecommitdiff
path: root/bin/efa
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-05-20 19:27:32 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-05-20 19:27:32 +0200
commit5ccbdc9d31d6c384f7630f745799113761fbefd0 (patch)
tree06f2879efd2acc4f2899624b9491c61b59bcaf37 /bin/efa
parent0fd9e8a907d79c82d58dd34d031db20462aed115 (diff)
efa: Added --exclude ("ausgewählte Verkehrsmittel")
Diffstat (limited to 'bin/efa')
-rwxr-xr-xbin/efa34
1 files changed, 34 insertions, 0 deletions
diff --git a/bin/efa b/bin/efa
index db89e54..9d8f1e5 100755
--- a/bin/efa
+++ b/bin/efa
@@ -21,6 +21,7 @@ my $cons;
my (@from, @to, @via);
my ($time, $time_depart, $time_arrive);
my $date;
+my @exclude;
my $maxinter;
my $restrict;
my $prefer;
@@ -118,6 +119,7 @@ GetOptions(
'date=s' => \$date,
'debug' => \$debug,
'depart=s' => \$time_depart,
+ 'exclude=s' => \@exclude,
'from=s{2}' => \@from,
'help' => sub {exec('perldoc', $0)},
'ignore-info=s' => \$ignore_info,
@@ -131,6 +133,8 @@ GetOptions(
'via=s{2}' => \@via,
);
+@exclude = split(/,/, join(',', @exclude));
+
unless (@from and @to) {
if (@ARGV == 4) {
(@from[0,1], @to[0,1]) = @ARGV;
@@ -165,6 +169,28 @@ if ($date) {
@post{'itdDateDay','itdDateMonth','itdDateYear'} = split(/\./, $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: invaled argument\n";
+ }
+ }
+ }
+}
+
if (defined($maxinter)) {
$post{maxChanges} = $maxinter;
}
@@ -203,6 +229,7 @@ $www->submit_form(
);
$content = $www->content;
+
if (check_ambiguous($content)) {
exit(1);
}
@@ -292,6 +319,13 @@ Journey end time (overrides --time/--depart)
Journey date
+=item B<--exclude> I<transports>
+
+Exclude I<transports> (comma separated list).
+
+Possible transports: zug, s-bahn, u-bahn, stadtbahn, tram, stadtbus, regionalbus,
+schnellbus, seilbahn, schiff, ast, sonstige
+
=item B<--max-change> I<number>
Print connections with at most I<number> interchanges