summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/apt-why18
1 files changed, 15 insertions, 3 deletions
diff --git a/bin/apt-why b/bin/apt-why
index 97af4b9..ed1e0a2 100755
--- a/bin/apt-why
+++ b/bin/apt-why
@@ -3,10 +3,14 @@ use strict;
use warnings;
use AptPkg::Cache;
use Switch;
+use Getopt::Long;
my $cache = AptPkg::Cache->new;
-my $packagename = pop or die("No packagename given");
-my $query = shift || '';
+my $not = 0;
+GetOptions(
+ "not" => \$not,
+);
+my $packagename = shift or die("No packagename given");
my $package = $cache->{$packagename};
unless($package) {
@@ -100,7 +104,7 @@ sub print_deps {
}
}
-if ($query eq 'not') {
+if ($not) {
print_deps(why_not($package->{RevDependsList}));
} else {
print_deps(why($package->{RevDependsList}));
@@ -131,3 +135,11 @@ An empty field means not installed.
If B<not> is specified, reverse dependencies prohibiting the install of
I<package> are shown. Else, reverse dependencies justifying the install
of I<package> are shown
+
+=head1 AUTHOR
+
+Daniel Friesel <derf@derf.homelinux.org>
+
+=head1 LICENSE
+
+ 0. You just DO WHAT THE FUCK YOU WANT TO.