diff options
Diffstat (limited to 'rpm-find-leaves')
-rw-r--r-- | rpm-find-leaves | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/rpm-find-leaves b/rpm-find-leaves index bc027f66..765d0eaa 100644 --- a/rpm-find-leaves +++ b/rpm-find-leaves @@ -15,8 +15,8 @@ my $usage = N("usage: %s [options] where [options] are from ", $0) . N(" -h|--help - print this help message. ") . N(" --root <path> - use the given root instead of / -") . N(" -g [group] - restrict results to given group. -") . N(" defaults is %s. +") . N(" -g [group] - restrict results to specified group. +") . N(" defaults to %s. ", $options{group}); while ($_ = shift) { @@ -28,8 +28,9 @@ while ($_ = shift) { }; $_ eq '-g' and do { $options{restrict_group} = 1; + next if !@ARGV || $ARGV[0] =~ /^-/; my $group = shift; - $group and $options{group} = $group; + $options{group} = $group; next; }; print $usage; exit 0; @@ -48,7 +49,7 @@ my @packages; my %l; my %provides; foreach my $pkg (@packages) { - next if $options{restrict_group} && $pkg->group !~ /$options{group}/oi; + next if $options{restrict_group} && $pkg->group !~ /\Q$options{group}/oi; $l{$pkg->name} = 1; push @{$provides{$_}}, $pkg->name foreach $pkg->provides_nosense; } |