diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-06-20 00:14:09 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-06-20 00:14:09 +0200 |
commit | 7d45ad0788a8ee72fc137b4722f223f673c693af (patch) | |
tree | 957edd6f72131945d493f7281e013a4bb5fbf604 /bin | |
parent | 90234c148e98ce9f7d26b37218a5f2db4c8b5858 (diff) |
apt-why: Simplified --deptype parsing
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/apt-why | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/bin/apt-why b/bin/apt-why index f5c2093..893fd6f 100755 --- a/bin/apt-why +++ b/bin/apt-why @@ -11,22 +11,16 @@ use Getopt::Long; my $cache = AptPkg::Cache->new; my $max_depth = 5; my $all = 0; -my @deptypes; -my @default_deptypes = ('Depends', 'Recommends', 'Suggests'); +my @deptypes = ('Depends', 'Recommends', 'Suggests'); GetOptions( 'all!' => \$all, - 'deptype=s' => \@deptypes, + 'deptype=s' => sub {shift; @deptypes = split(/,/, shift)}, 'depth=i' => \$max_depth, 'h|?|help' => \&usage, ); my $packagename = shift or die("No packagename given"); my @known; -@deptypes = split(/,/, join(',', @deptypes)); -unless (@deptypes) { - @deptypes = @default_deptypes; -} - sub usage { exec('perldoc', '-F', $0) or die("See perldoc -F $0"); } |