From e8d4fa8c1cacc4062a573c46ced2e7c1ee25212a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 30 Jul 2010 00:39:28 +0200 Subject: icli -lq: Support filtering output with -h/-g --- bin/icli | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/icli b/bin/icli index 4721990..bfb959c 100755 --- a/bin/icli +++ b/bin/icli @@ -131,6 +131,10 @@ sub display_queue { (values %{$data->{hosts}}, map { @{$_} } values %{$data->{services}}); + if (@for_hosts) { + @queue = grep { $_->{host_name} ~~ \@for_hosts } @queue; + } + printf( "%-25.25s %-20.20s %-19s %-19s\n", 'Host', @@ -239,7 +243,7 @@ foreach my $group (@for_groups) { } } -if (@for_hosts) { +if (@for_hosts and $list_type ~~ [qw/s h/]) { foreach my $host (@for_hosts) { if (have_host($host)) { display_host( -- cgit v1.2.3