diff options
author | Daniel Friesel <derf@finalrewind.org> | 2013-12-15 22:46:42 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2013-12-15 22:46:42 +0100 |
commit | 7de9fde0c5ff2fb109f27fde03526a0572b69e74 (patch) | |
tree | 9b38ba7f16e79136c60b7b70908dc15068f4d40c /bin | |
parent | 628378784da47113536a1a14d173fd561a08cc2c (diff) |
--relative: right-align remaining time
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/aseag-m | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/bin/aseag-m b/bin/aseag-m index ed5b041..7643466 100755 --- a/bin/aseag-m +++ b/bin/aseag-m @@ -67,22 +67,24 @@ sub show_version { sub display_result { my (@lines) = @_; - my @line_length; + my @format = qw(%- %- %-); if ( not @lines ) { die("Nothing to show\n"); } + if ($relative_times) { + $format[2] = q{%}; + } + for my $i ( 0 .. 2 ) { - $line_length[$i] = max map { length( $_->[$i] ) } @lines; + $format[$i] .= max map { length( $_->[$i] ) } @lines; + $format[$i] .= 's'; } for my $line (@lines) { - printf( - join( q{ }, ( map { "%-${_}s" } @line_length ) ) . "\n", - @{$line}[ 0 .. 2 ] - ); + printf( join( q{ }, @format ) . "\n", @{$line}[ 0 .. 2 ] ); if ($full_route) { print "\n" . $line->[3] . "\n\n\n"; |