summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-04-06 22:23:05 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-04-06 22:23:05 +0200
commit22728aaab49ed08c89c053313779e09ee54b99a7 (patch)
treea122c664995f64ca2524ce108c114b164b65de69
parent6bb6c308552d1d9e092d245b08c85b6e589fa9d7 (diff)
add -j/--with-jid option
-rwxr-xr-xbin/hafas-m11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/hafas-m b/bin/hafas-m
index 4583248..f881589 100755
--- a/bin/hafas-m
+++ b/bin/hafas-m
@@ -16,6 +16,7 @@ use Travel::Status::DE::HAFAS;
my ( $date, $time, $language );
my $arrivals;
+my $show_jid;
my $types = q{};
my $developer_mode;
my $via;
@@ -37,6 +38,7 @@ GetOptions(
'a|arrivals' => \$arrivals,
'd|date=s' => \$date,
'h|help' => sub { show_help(0) },
+ 'j|with-jid' => \$show_jid,
'l|language=s' => \$language,
'm|mot=s' => \$types,
's|service=s' => \$service,
@@ -611,6 +613,10 @@ for my $d (@results) {
. $info_line;
}
+ if ($show_jid) {
+ $info_line = $d->id . ' ' . $info_line;
+ }
+
my $entry = [
( $d->is_cancelled ? '--:--' : $d->datetime->strftime('%H:%M') )
. ( $d->tz_offset ? q{*} : ( q{ } x $offset_len ) ),
@@ -745,6 +751,11 @@ the end station.
Date to list departures for. Default: today.
+=item B<-j>, B<--with-jid>
+
+Show journey IDs in arrival/departure board. These can be used to obtain
+details on individual journeys with subsequent B<hafas-m> invocations.
+
=item B<--json>
Print result(s) as JSON and exit. This is a dump of internal data structures