summaryrefslogtreecommitdiff
path: root/bin/dbris-m
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-12-27 09:10:49 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-12-27 09:10:49 +0100
commit31ef58b4217a60429f77b58a5b2c9c549f40d19e (patch)
treeecd11b7ab5afb530b344a22ae987366ea4be1d33 /bin/dbris-m
parent6d44f63a1109800341f514ac2d75982e27be13b3 (diff)
station board: add mode-of-transit filter
Diffstat (limited to 'bin/dbris-m')
-rwxr-xr-xbin/dbris-m24
1 files changed, 15 insertions, 9 deletions
diff --git a/bin/dbris-m b/bin/dbris-m
index 9dbaf97..8733915 100755
--- a/bin/dbris-m
+++ b/bin/dbris-m
@@ -14,6 +14,7 @@ use List::Util qw(max);
use Travel::Status::DE::DBRIS;
my ( $date, $time );
+my $mots;
my $developer_mode;
my $show_jid;
my $use_cache = 1;
@@ -31,15 +32,16 @@ my $output_bold = -t STDOUT ? "\033[1m" : q{};
my $output_reset = -t STDOUT ? "\033[0m" : q{};
GetOptions(
- 'd|date=s' => \$date,
- 'h|help' => sub { show_help(0) },
- 'j|with-jid' => \$show_jid,
- 't|time=s' => \$time,
- 'V|version' => \&show_version,
- 'cache!' => \$use_cache,
- 'devmode' => \$developer_mode,
- 'json' => \$json_output,
- 'raw-json' => \$raw_json_output,
+ 'd|date=s' => \$date,
+ 'h|help' => sub { show_help(0) },
+ 'j|with-jid' => \$show_jid,
+ 'm|modes-of-transit=s' => \$mots,
+ 't|time=s' => \$time,
+ 'V|version' => \&show_version,
+ 'cache!' => \$use_cache,
+ 'devmode' => \$developer_mode,
+ 'json' => \$json_output,
+ 'raw-json' => \$raw_json_output,
) or show_help(1);
@@ -140,6 +142,10 @@ if ( $date or $time ) {
$opt{datetime} = $dt;
}
+if ($mots) {
+ $opt{modes_of_transit} = [ split( qr{, *}, $mots ) ];
+}
+
my $status = Travel::Status::DE::DBRIS->new(%opt);
sub show_help {