[libcode-tidyall-perl] 06/374: add-a
Jonas Smedegaard
js at alioth.debian.org
Sun Sep 29 22:25:39 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 83754eb181ae3830782c982ab857bdbbc424d5c9
Author: Jonathan Swartz <swartz at pobox.com>
Date: Fri May 25 01:00:20 2012 -0700
add-a
---
bin/tidyall | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/bin/tidyall b/bin/tidyall
new file mode 100755
index 0000000..0cf6cf1
--- /dev/null
+++ b/bin/tidyall
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+use Getopt::Long;
+use Pod::Usage;
+use Code::TidyAll::Util qw(can_load);
+use strict;
+use warnings;
+
+sub usage {
+ my $msg = shift;
+ print "$msg\n" if $msg;
+ require Pod::Usage;
+ Pod::Usage::pod2usage( { verbose => 2 } );
+}
+
+my %params;
+my $class = 'Code::TidyAll';
+
+GetOptions(
+ 'backup_dir' => \$params{backup_dir},
+ 'backup_keep' => \$params{backup_keep},
+ 'cache_dir' => \$params{cache_dir},
+ 'class' => \$class,
+ 'data_dir' => \$params{data_dir},
+ 'git' => \$git_mode,
+ 'c|conf' => \$params{conf_file},
+ 'h|help' => \$help,
+ 'r|recursive' => \$params{recursive},
+ 'svn' => \$svn_mode,
+) or usage();
+
+usage("-c|--conf_file required") if !$params{conf_file};
+die "cannot load '$class'" unless can_load($class);
+
+my @paths = @ARGV or usage("path(s) required");
+ at paths = uniq( map { $class->files_from_svn_status($_) } @paths ) if $svn_mode;
+ at paths = uniq( map { $class->files_from_git_status($_) } @paths ) if $git_mode;
+
+my $ct = $class->new(%params);
+foreach my $path (@paths) {
+ $ct->process_path($path);
+}
--
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