[libcode-tidyall-perl] 22/374: document exit status

Jonas Smedegaard js at alioth.debian.org
Sun Sep 29 22:25:41 UTC 2013


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libcode-tidyall-perl.

commit 9b1132e1ef51398409dafce2ffad452ba571105b
Author: Jonathan Swartz <swartz at pobox.com>
Date:   Fri Jun 15 19:30:24 2012 -0500

    document exit status
---
 bin/tidyall |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/bin/tidyall b/bin/tidyall
index c2c03fc..4a781b8 100755
--- a/bin/tidyall
+++ b/bin/tidyall
@@ -38,18 +38,21 @@ die "cannot load '$class'" unless can_load($class);
 
 $params{conf_file} ||= "$params{root_dir}/tidyall.ini" if ( $params{root_dir} );
 
+my $result;
 if ($all) {
     $params{conf_file} ||= $class->find_conf_file( realpath(), "tidyall.ini" );
     my $ct = $class->new(%params);
-    $ct->process_all();
+    $result = $ct->process_all();
 }
 else {
     my @files = @ARGV or die "file(s) or -a required";
     $params{conf_file} ||= $class->find_conf_file( dirname( $files[0] ), "tidyall.ini" );
     my $ct = $class->new(%params);
-    $ct->process_files(@files);
+    $result = $ct->process_files(@files);
 }
 
+exit($result->error_count ? 1 : 0);
+
 1;
 
 __END__
@@ -264,3 +267,10 @@ run. It may be specified as "30min" or "4h" or any string acceptable to
 L<Time::Duration::Parse>. It defaults to "1h" (1 hour).
 
 You can turn off backups with C<--no-backups>.
+
+=head1 EXIT STATUS
+
+C<tidyall> will exit with status 1 if any errors occurred while processing
+files, and 0 otherwise.
+
+=cut

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcode-tidyall-perl.git



More information about the Pkg-perl-cvs-commits mailing list