Fix some minor bugs in the Module Manager.

- Fix installation of module.
- Exit after listing modules.
This commit is contained in:
Peter Powell 2017-07-12 12:04:42 +01:00
parent 3cf2dd8247
commit 61e299c2c9

View File

@ -254,7 +254,7 @@ sub resolve_deps {
} }
command 'install', 'Install a third-party module', sub { command 'install', 'Install a third-party module', sub {
for my $mod (@ARGV) { for my $mod (@_) {
my $vers = $mod =~ s/=([-0-9.]+)// ? $1 : undef; my $vers = $mod =~ s/=([-0-9.]+)// ? $1 : undef;
$mod = lc $mod; $mod = lc $mod;
unless ($modules{$mod}) { unless ($modules{$mod}) {
@ -296,6 +296,7 @@ command 'list', 'List available third-party modules', sub {
my $vers = join ' ', map { $_ eq $instver ? "\e[1m$_\e[m" : $_ } @vers; my $vers = join ' ', map { $_ eq $instver ? "\e[1m$_\e[m" : $_ } @vers;
print "$mod ($vers) - $desc\n"; print "$mod ($vers) - $desc\n";
} }
exit 0;
}; };
execute_command @ARGV; execute_command @ARGV;