summaryrefslogtreecommitdiff
path: root/bin/hafas-m
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-09-10 10:23:50 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-09-10 10:23:50 +0200
commit0ebd8e6bb379dba71239050ee643ff78058a95e5 (patch)
treeedca011c1265bfd6bd437bfc38af5d4840706953 /bin/hafas-m
parent556f259834d75cad6a2feeb1c5106204d5921a28 (diff)
add service list
Diffstat (limited to 'bin/hafas-m')
-rwxr-xr-xbin/hafas-m10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/hafas-m b/bin/hafas-m
index cc78d26..ee3ae78 100755
--- a/bin/hafas-m
+++ b/bin/hafas-m
@@ -17,6 +17,7 @@ my $ignore_late = 0;
my $types = q{};
my $language;
my $developer_mode;
+my $list_services;
my @output;
@@ -32,9 +33,18 @@ GetOptions(
't|time=s' => \$time,
'V|version' => \&show_version,
'devmode' => \$developer_mode,
+ 'list' => \$list_services,
) or show_help(1);
+if ($list_services) {
+ printf( "%-40s %-14s %s\n\n", 'operator', 'abbr. (-s)', 'url (-u)' );
+ for my $service ( Travel::Status::DE::HAFAS::get_services() ) {
+ printf( "%-40s %-14s %s\n", @{$service}{qw(name shortname url)} );
+ }
+ exit 0;
+}
+
for my $type ( split( qr{,}, $types ) ) {
if ( substr( $type, 0, 1 ) eq q{!} ) {
$train_type{ substr( $type, 1 ) } = 0;