my $module = {};
-my ( $verbose, $cur_dir, $cmdline_verbose, $DebugLevel, $help, $show_version, $get_module_version );
+my ( $verbose, $cur_dir, $cmdline_verbose, $DebugLevel, $help, $show_version, $get_module_version, $short );
unless (
GetOptions(
"verbose|v+" => \$cmdline_verbose,
"get-module-version|get-version|gv" => \$get_module_version,
+ "short|s" => \$short,
"DebugLevel|Debug|D=i" => \$DebugLevel,
"help|h|?" => \$help,
"version|V" => \$show_version,
exit 0;
}
+if ( $verbose and $short ) {
+ warn "Optionen --verbose und --short vertragen sich nicht.\n";
+ exit 1;
+}
+
print "Geladene Module: " . Dumper(\%INC) if $verbose > 1;
my $arch = $Config{'archname'};
printf "insgesamt %d Module gefunden.\n\n", $global_count if $verbose;
for my $m ( sort { lc($a) cmp lc($b) } keys %$module ) {
- printf " - %s\n", $m;
- for my $mod_info ( @{ $module->{$m}{'locations'} } ) {
- my $version = $get_module_version ? ( " (" . $mod_info->{'version'} . ")" ) : '';
- printf " %-11s %s%s\n", $mod_info->{'loc'}, $mod_info->{'path'}, $version;
+ if ( $short ) {
+ my $version = $get_module_version ? ( " (" . $module->{$m}{'version'} . ")" ) : '';
+ printf "%-11s %s%s\n", $module->{$m}{'first_location'}, $m, $version;
+ }
+ else {
+ printf " - %s\n", $m;
+ for my $mod_info ( @{ $module->{$m}{'locations'} } ) {
+ my $version = $get_module_version ? ( " (" . $mod_info->{'version'} . ")" ) : '';
+ printf " %-11s %s%s\n", $mod_info->{'loc'}, $mod_info->{'path'}, $version;
+ }
}
}