summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-04-05 10:36:38 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-04-05 10:36:38 +0200
commit88650d91dc4949e1ad7f4008bef56db3543eb24e (patch)
tree2a9a41b40fbe383b1c7ac706564b805a90a0ca13
parent03879bd7766e784a3f431e41cfdd9ecc1bed6831 (diff)
Shorten --tabwidth code
-rwxr-xr-xbin/apt-why9
1 files changed, 2 insertions, 7 deletions
diff --git a/bin/apt-why b/bin/apt-why
index 195d7bd..9276471 100755
--- a/bin/apt-why
+++ b/bin/apt-why
@@ -10,7 +10,6 @@ use Getopt::Long;
my $cache = AptPkg::Cache->new;
my $max_depth = 5;
my $all = 0;
-my $tabwidth;
my $tabsign = "\t";
my @deptypes = qw/Depends Recommends Suggests/;
my @known;
@@ -58,18 +57,14 @@ sub recurse {
GetOptions(
'all!' => \$all,
- 'deptype=s' => sub {@deptypes = split(/,/, $_[1])},
+ 'deptype=s' => sub { @deptypes = split(/,/, $_[1]) },
'depth=i' => \$max_depth,
- 'tabwidth=i' => \$tabwidth,
+ 'tabwidth=i' => sub { $tabsign = ' ' x $_[1] },
'h|?|help' => \&usage,
);
my $packagename = shift or die("Usage: $0 [options] <package>; see $0 --help\n");
-if (defined $tabwidth) {
- $tabsign = ' ' x $tabwidth;
-}
-
if (not defined $cache->{$packagename}) {
die("No such package: $packagename\n");
}