diff options
author | Daniel Friesel <derf@finalrewind.org> | 2015-09-11 18:22:34 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2015-09-11 18:22:34 +0200 |
commit | de432ead84057a6f9234cbcb56004d625333a7bd (patch) | |
tree | 3d86faf387f42e05f0c6cf329031ae820e476d0d /bin/hafas-m | |
parent | 53a32113d048c2ab7b98771ae23e470d562bb40a (diff) |
add -m help / -m list support
Diffstat (limited to 'bin/hafas-m')
-rwxr-xr-x | bin/hafas-m | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/hafas-m b/bin/hafas-m index f279b04..dc053c9 100755 --- a/bin/hafas-m +++ b/bin/hafas-m @@ -6,6 +6,7 @@ use 5.010; our $VERSION = '1.05'; use Getopt::Long qw(:config no_ignore_case); +use List::MoreUtils qw(uniq); use List::Util qw(first max); use Travel::Status::DE::HAFAS; @@ -58,6 +59,16 @@ for my $type ( split( qr{,}, $types ) ) { } } +if ( $train_type{help} or $train_type{list} or $train_type{'?'} ) { + my @mots + = @{ Travel::Status::DE::HAFAS::get_service($service)->{productbits} }; + @mots = grep { $_ ne 'x' } @mots; + @mots = uniq @mots; + @mots = sort @mots; + say join( "\n", @mots ); + exit 0; +} + my $status = Travel::Status::DE::HAFAS->new( date => $date, language => $language, |