aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2011-05-10 20:51:35 +0000
committerPascal Terjan <pterjan@mageia.org>2011-05-10 20:51:35 +0000
commita65d0962c595893543fa2b4b486924405f5264d2 (patch)
tree7d32e34842604ae0bb90c17cb67f4fa27e117c56
parent352fd710a9a5154fc6d405992bc895cd15f48b3f (diff)
downloadmga-youri-submit-a65d0962c595893543fa2b4b486924405f5264d2.tar
mga-youri-submit-a65d0962c595893543fa2b4b486924405f5264d2.tar.gz
mga-youri-submit-a65d0962c595893543fa2b4b486924405f5264d2.tar.bz2
mga-youri-submit-a65d0962c595893543fa2b4b486924405f5264d2.tar.xz
mga-youri-submit-a65d0962c595893543fa2b4b486924405f5264d2.zip
Allow listing posts and rejects
-rwxr-xr-xbin/youri-submit.in16
1 files changed, 6 insertions, 10 deletions
diff --git a/bin/youri-submit.in b/bin/youri-submit.in
index a788e15..fa8488f 100755
--- a/bin/youri-submit.in
+++ b/bin/youri-submit.in
@@ -79,10 +79,11 @@ Produce more verbose output (can be used more than once)
Don't perform any modification.
-=item B<--list> I<category>
+=item B<--list> I<category> I[target]
List available items from given category and exits. Category must be either
-B<targets>, B<actions> or B<checks>. A target is needed for the two last ones.
+B<targets>, B<actions>, B<checks>, B<posts> or B<rejects>.
+A target is needed except for B<targets>.
=item B<--help> I<category>
@@ -186,17 +187,12 @@ if ($config->get_arg('list')) {
unless $category;
if ($category eq 'targets') {
print join(' ', keys %{$config->get_param('targets')});
- } elsif ($category eq 'checks' || $category eq 'actions') {
+ } elsif ($category =~ /^(actions|checks|posts|rejects)$/) {
my $target = $ARGV[1];
pod2usage(-verbose => 0, -message => "No target specified, aborting\n")
unless $target;
- if ($category eq 'checks') {
- my $checks = $config->get_param('targets')->{$target}->{checks};
- print join(' ', @{$checks}) if $checks;
- } else {
- my $actions = $config->get_param('targets')->{$target}->{actions};
- print join(' ', @{$actions}) if $actions;
- }
+ my $items = $config->get_param('targets')->{$target}->{$category};
+ print join(' ', @{$items}) if $items;
} else {
pod2usage(-verbose => 0, -message => "Invalid category $category, aborting\n")
}