[libcode-tidyall-perl] 52/374: add --only-plugins
Jonas Smedegaard
js at alioth.debian.org
Sun Sep 29 22:25:47 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 dedb21e4c466382e69b09e248afe5d772ed50583
Author: Jonathan Swartz <swartz at pobox.com>
Date: Tue Jun 26 16:17:34 2012 -0700
add --only-plugins
---
bin/tidyall | 3 +++
lib/Code/TidyAll.pm | 5 +++++
2 files changed, 8 insertions(+)
diff --git a/bin/tidyall b/bin/tidyall
index 0e2fa17..506a152 100755
--- a/bin/tidyall
+++ b/bin/tidyall
@@ -24,7 +24,9 @@ GetOptions(
'data-dir=s' => \$params{data_dir},
'no-backups' => \$params{no_backups},
'no-cache' => \$params{no_cache},
+ 'only-plugins' => \$params{only_plugins},
'root-dir=s' => \$params{root_dir},
+ 'stdout' => \$params{stdout},
'a|all' => \$all,
'h|help' => \$help,
'q|quiet' => \$params{quiet},
@@ -38,6 +40,7 @@ die "cannot load '$class'" unless can_load($class);
%params = slice_def( \%params );
$params{conf_file} ||= "$params{root_dir}/tidyall.ini" if ( $params{root_dir} );
+$params{only_plugins} = [ split( /\s*,\s*/, $params{only_plugins} ) ] if $params{only_plugins};
my $result;
if ($all) {
diff --git a/lib/Code/TidyAll.pm b/lib/Code/TidyAll.pm
index a2074a6..f925265 100644
--- a/lib/Code/TidyAll.pm
+++ b/lib/Code/TidyAll.pm
@@ -21,6 +21,7 @@ sub valid_params {
data_dir
no_backups
no_cache
+ only_plugins
plugins
root_dir
quiet
@@ -60,6 +61,10 @@ sub new {
#
if ( my $conf_file = $params{conf_file} ) {
my $conf_params = $class->_read_conf_file($conf_file);
+ if ( my $only_plugins = $params{only_plugins} ) {
+ my %allow = map { ( $_, 1 ) } @$only_plugins;
+ $conf_params = { slice_grep { $allow{$_} } $conf_params };
+ }
my $main_params = delete( $conf_params->{'_'} ) || {};
%params = (
plugins => $conf_params,
--
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