From a65d0962c595893543fa2b4b486924405f5264d2 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 10 May 2011 20:51:35 +0000 Subject: Allow listing posts and rejects --- bin/youri-submit.in | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'bin') 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 +=item B<--list> I I[target] List available items from given category and exits. Category must be either -B, B or B. A target is needed for the two last ones. +B, B, B, B or B. +A target is needed except for B. =item B<--help> I @@ -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") } -- cgit v1.2.1