summaryrefslogtreecommitdiff
path: root/bin/dbris
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-01-19 00:15:53 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2025-01-19 00:15:53 +0100
commit33cc19fca4c95c58e067e8e2df9bdf427be434e4 (patch)
treec238fdd563e2288b637f4f4e98b3e23d8d5655a4 /bin/dbris
parent5075461af23c7016f045450808b4302d4109934f (diff)
Add basic support for discounts (BahnCard 25 / 50 / 100)
Diffstat (limited to 'bin/dbris')
-rwxr-xr-xbin/dbris6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/dbris b/bin/dbris
index d6a642d..b783037 100755
--- a/bin/dbris
+++ b/bin/dbris
@@ -16,6 +16,7 @@ use Travel::Routing::DE::DBRIS;
my ( $date, $time, $from, $to );
my $mots;
+my $discounts;
my $developer_mode;
my ( $json_output, $raw_json_output );
my $use_cache = 1;
@@ -33,6 +34,7 @@ my $output_reset = -t STDOUT ? "\033[0m" : q{};
GetOptions(
'd|date=s' => \$date,
+ 'D|discounts=s' => \$discounts,
'h|help' => sub { show_help(0) },
'm|modes-of-transit=s' => \$mots,
't|time=s' => \$time,
@@ -134,6 +136,10 @@ if ($mots) {
$opt{modes_of_transit} = [ split( qr{, *}, $mots ) ];
}
+if ($discounts) {
+ $opt{discounts} = [ split( qr{, *}, $discounts ) ];
+}
+
sub show_help {
my ($code) = @_;