From 7d45ad0788a8ee72fc137b4722f223f673c693af Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 20 Jun 2009 00:14:09 +0200 Subject: apt-why: Simplified --deptype parsing --- bin/apt-why | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'bin') 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"); } -- cgit v1.2.3