summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-03-24 14:00:12 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-03-24 14:00:12 +0100
commitb85f394224f151809a425e727f6e55bea22816ce (patch)
treed0abccbbae83a7fdd98a2435a31df3891686d0d1 /bin
parente7867caf2ef6877dc513f438a6a1fe7d4b7fc5c5 (diff)
Add --max-change / max_change options
Diffstat (limited to 'bin')
-rwxr-xr-xbin/hafas15
1 files changed, 11 insertions, 4 deletions
diff --git a/bin/hafas b/bin/hafas
index 81c8784..0fe463e 100755
--- a/bin/hafas
+++ b/bin/hafas
@@ -22,7 +22,8 @@ my ( $json_output, $raw_json_output );
my $show_full_route;
my ( $list_services, $service );
my ( @excluded_mots, @exclusive_mots );
-my $verbosity = 0;
+my $max_change = undef;
+my $verbosity = 0;
my @output;
my %min_verbosity = (
@@ -45,6 +46,7 @@ my $output_reset = -t STDOUT ? "\033[0m" : q{};
GetOptions(
'a|arrive=s' => sub { $arrival = 1; $time = $_[1] },
+ 'c|max-change=s' => \$max_change,
'd|date=s' => \$date,
'h|help' => sub { show_help(0) },
'f|full-route' => \$show_full_route,
@@ -82,12 +84,13 @@ if ( not $from_stop and $to_stop ) {
}
my %opt = (
- excluded_mots => \@excluded_mots,
- exclusive_mots => \@exclusive_mots,
+ service => $service,
from_stop => $from_stop,
to_stop => $to_stop,
+ excluded_mots => \@excluded_mots,
+ exclusive_mots => \@exclusive_mots,
+ max_change => $max_change,
developer_mode => $developer_mode,
- service => $service,
arrival => $arrival,
language => $language,
);
@@ -468,6 +471,10 @@ between two stops and prints the results.
Request connections that arrive at the destination before I<hh>:I<mm>.
Overrides B<--time> / B<--depart>.
+=item B<-c>, B<--max-change> I<count>
+
+Request connections with no more than I<count> changeovers.
+
=item B<-d>, B<--date> I<dd>.I<mm>.[I<yyyy>]
Planned departure (or arrival) date. Default: today.