diff options
Diffstat (limited to 'utils/rhrd-group')
-rwxr-xr-x | utils/rhrd-group | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/utils/rhrd-group b/utils/rhrd-group index 9d73adb..088bc10 100755 --- a/utils/rhrd-group +++ b/utils/rhrd-group @@ -25,7 +25,7 @@ use RHRD::rddb; sub print_usage { - print STDERR "Usage: rhrd-group list\n" . + print STDERR "Usage: rhrd-group list [ (shows|jingles|pools) ]\n" . " rhrd-group (check|remove|get-members|get-carts|get-reports) <groupname>\n" . " rhrd-group add <groupname> [ <description> ]\n" . " rhrd-group (add-member|remove-member|is-member) <groupname> <user>\n" . @@ -35,9 +35,14 @@ sub print_usage sub list { - my ($ctx) = @_; + my ($ctx, $type) = @_; - my @groups = RHRD::rddb::list_groups($ctx); + if(defined($type) && $type ne "shows" && $type ne "jingles" && $type ne "pools") { + print_usage(); + return 1; + } + + my @groups = RHRD::rddb::list_groups($ctx, $type); if(!defined $groups[0] && defined $groups[1]) { print STDERR "$groups[1]: $groups[2]"; return 1; @@ -242,11 +247,11 @@ my $ret = 0; my ($ctx, $status, $errorstring) = RHRD::rddb::init(); if(defined $ctx) { if($cmd eq "list") { - if($num_args != 1) { + if($num_args < 1 || $num_args > 2) { print_usage(); $ret = 1; } else { - $ret = list($ctx); + $ret = list($ctx, $ARGV[1]); } } elsif($cmd eq "check") { |