summaryrefslogtreecommitdiff
path: root/bin/hafas-m
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-10-03 08:04:36 +0200
committerDaniel Friesel <derf@finalrewind.org>2022-10-03 08:04:36 +0200
commit4a3feb4cb5f97e5ae992bca9b34042c162580238 (patch)
tree19d16663f8fc66444425f5d16810a1a4be5a8f36 /bin/hafas-m
parent5c2e92955a045a1245123629ca0915b0b9bfd213 (diff)
mgate: add message support
Diffstat (limited to 'bin/hafas-m')
-rwxr-xr-xbin/hafas-m13
1 files changed, 9 insertions, 4 deletions
diff --git a/bin/hafas-m b/bin/hafas-m
index 95e01a9..d4590f6 100755
--- a/bin/hafas-m
+++ b/bin/hafas-m
@@ -185,10 +185,10 @@ sub display_result {
print "\n";
$first_message = 0;
}
- printf( "# %s\n", $msg->header );
- if ( $msg->lead ) {
- printf( "# %s\n", $msg->lead );
+ if ( $msg->short ) {
+ printf( "# %s\n", $msg->short );
}
+ printf( "# %s\n", $msg->text );
}
}
@@ -219,7 +219,12 @@ my $message_id = 1;
for my $m ( $status->messages ) {
if ( $m->ref_count > 1 ) {
$m->{id} = $message_id++;
- printf( "# (%d) %s\n# %s\n\n", $m->{id}, $m->header, $m->lead );
+ if ( $m->short ) {
+ printf( "# (%d) %s\n# %s\n\n", $m->{id}, $m->short, $m->text );
+ }
+ else {
+ printf( "# (%d) %s\n\n", $m->{id}, $m->text );
+ }
}
}