Loading bin/efa-m +51 −20 Original line number Diff line number Diff line Loading @@ -11,14 +11,14 @@ use Getopt::Long qw(:config no_ignore_case); use List::Util qw(max); use Travel::Status::DE::VRR; my ( $date, $time, $input_type ); my ( $date, $time, $input_type, $list_lines ); my ( @grep_lines, @grep_platforms ); my @output; GetOptions( 'd|date=s' => \$date, 'h|help' => sub { show_help(0) }, 'l|line=s@' => \@grep_lines, 'L|linelist' => \$list_lines, 'p|platform=s@' => \@grep_platforms, 't|time=s' => \$time, 'V|version' => \&show_version, Loading Loading @@ -98,11 +98,27 @@ sub display_result { return; } if ( my $err = $status->errstr ) { say STDERR "Request error: ${err}"; exit 2; sub show_lines { my @output; for my $l ( $status->lines ) { if ( @grep_lines and not( $l->name ~~ \@grep_lines ) ) { next; } push( @output, [ $l->type, $l->name, $l->direction // q{}, $l->route // q{} ] ); } display_result(@output); return; } sub show_results { my @output; for my $d ( $status->results ) { my $platform = $d->platform; Loading @@ -126,6 +142,21 @@ for my $d ( $status->results ) { display_result(@output); return; } if ( my $err = $status->errstr ) { say STDERR "Request error: ${err}"; exit 2; } if ($list_lines) { show_lines(); } else { show_results(); } __END__ =head1 NAME Loading Loading
bin/efa-m +51 −20 Original line number Diff line number Diff line Loading @@ -11,14 +11,14 @@ use Getopt::Long qw(:config no_ignore_case); use List::Util qw(max); use Travel::Status::DE::VRR; my ( $date, $time, $input_type ); my ( $date, $time, $input_type, $list_lines ); my ( @grep_lines, @grep_platforms ); my @output; GetOptions( 'd|date=s' => \$date, 'h|help' => sub { show_help(0) }, 'l|line=s@' => \@grep_lines, 'L|linelist' => \$list_lines, 'p|platform=s@' => \@grep_platforms, 't|time=s' => \$time, 'V|version' => \&show_version, Loading Loading @@ -98,11 +98,27 @@ sub display_result { return; } if ( my $err = $status->errstr ) { say STDERR "Request error: ${err}"; exit 2; sub show_lines { my @output; for my $l ( $status->lines ) { if ( @grep_lines and not( $l->name ~~ \@grep_lines ) ) { next; } push( @output, [ $l->type, $l->name, $l->direction // q{}, $l->route // q{} ] ); } display_result(@output); return; } sub show_results { my @output; for my $d ( $status->results ) { my $platform = $d->platform; Loading @@ -126,6 +142,21 @@ for my $d ( $status->results ) { display_result(@output); return; } if ( my $err = $status->errstr ) { say STDERR "Request error: ${err}"; exit 2; } if ($list_lines) { show_lines(); } else { show_results(); } __END__ =head1 NAME Loading