From 4d7dacf51d7ebc8928ef2fa432f05d878d370430 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 19 Jun 2014 11:52:29 +0200 Subject: minor code cleanup --- bin/icli | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/icli b/bin/icli index cda0319..220d0be 100755 --- a/bin/icli +++ b/bin/icli @@ -115,14 +115,14 @@ sub parse_duration { my %factors = ( s => 1, m => 60, - h => 3600, - d => 86400, - w => 604800, + h => 3_600, + d => 86_400, + w => 604_800, ); $raw =~ m{ ^ (? [.0-9]+ ) \s* (? [mhdw] )? $ }x or die( -"Cannot parse '$raw' - must be a number with an optional unit (s/m/h/d/w)" +"Cannot parse '$raw' - must be a duration like '50s', '2m', '10h' or '1d'" ); if ( $+{unit} ) { @@ -199,7 +199,7 @@ sub split_by_words { ) { if ($tr_space) { - $cur_str .= ' '; + $cur_str .= q{ }; } else { $tr_space = 1; @@ -207,7 +207,7 @@ sub split_by_words { $cur_str .= shift(@words); } if (@ret) { - $cur_str = ( ' ' x $padding ) . $cur_str; + $cur_str = ( q{ } x $padding ) . $cur_str; } push( @ret, $cur_str ); } @@ -688,7 +688,7 @@ sub display_downtime { printf( '%-17.17s', $d->{'fixed'} ? ' Fixed' - : ' ' . pretty_duration_abs( $d->{duration} ) ); + : q{ } . pretty_duration_abs( $d->{duration} ) ); } if ( $v >= 2 ) { print( $d->{comment} ); @@ -870,7 +870,7 @@ sub display_service { $n_width += 4; } - print ' '; + print q{ }; print break_str( $s->{plugin_output}, $n_width ); @@ -1184,7 +1184,7 @@ elsif ( $list_type eq 'q' ) { } elsif ( $list_type eq 'd' ) { if ( exists $data->{hostdowntimes} ) { - say "Host downtimes:"; + say 'Host downtimes:'; if ( $verbosity == 1 ) { printf( "%-25.25s %-20.20s %-20.20s\n", 'Host', 'start', 'stop' ); } @@ -1197,7 +1197,7 @@ elsif ( $list_type eq 'd' ) { } } else { - say "No host downtimes"; + say 'No host downtimes'; } if ( exists $data->{servicedowntimes} ) { say "\nService downtimes:"; -- cgit v1.2.3