X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=lib%2FUtils.pm;h=acebce5074f634f4608c90ddd4b8e64fdc60083c;hb=741c2b2cf2529abe150429f0f9ccd5f4f9b19c90;hp=1bed47b006b84bcdd300e06c008b1841714e4ca9;hpb=818c8ddc426ee4287cff5e614054ceeabf313416;p=clearscm.git diff --git a/lib/Utils.pm b/lib/Utils.pm index 1bed47b..acebce5 100644 --- a/lib/Utils.pm +++ b/lib/Utils.pm @@ -311,6 +311,41 @@ Returns: sub GetPassword (;$) { my ($prompt) = @_; + +=pod + +=head2 GetPassword (;$prompt) + +Prompt for a password + +Parameters: + +=for html
+ +=over + +=item $prompt + +Prompt string to use (Default: "Password:") + +=back + +=for html
+ +Returns: + +=for html
+ +=over + +=item $password + +=back + +=for html
+ +=cut + $prompt ||= 'Password'; @@ -494,7 +529,7 @@ Returns: =cut - open my $pipe, '|', $to + open my $pipe, '|-', $to or error "Unable to open pipe - $!", 1; foreach (@output) { @@ -792,7 +827,8 @@ and the values of the hash will be the counters. =item $log -Logger object to log stats to (if specified) +Logger object to log stats to (if specified). Note: if the Logger object has +errors or warnings then they will be automatically included in the output. =back @@ -814,7 +850,12 @@ Returns: my $msg = "$FindBin::Script Run Statistics:"; - if (scalar keys %$total) { + if ($log and ref $log eq 'Logger') { + $total->{errors} = $log->{errors}; + $total->{warnings} = $log->{warnings}; + } # if + + if (keys %$total) { # Display statistics (if any) if ($log) { $log->msg ($msg); @@ -823,10 +864,10 @@ Returns: } # if foreach (sort keys %$total) { - $msg = $$total{$_} . "\t $_"; + $msg = $total->{$_} . "\t $_"; if ($log) { - $log->msg ($$total{$_} . "\t $_"); + $log->msg ($total->{$_} . "\t $_"); } else { display $msg; } # if