From 0ebd8e6bb379dba71239050ee643ff78058a95e5 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 10 Sep 2015 10:23:50 +0200 Subject: add service list --- bin/hafas-m | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bin/hafas-m') 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; -- cgit v1.2.3