Skip to content

Commit

Permalink
Add panda list --installed, listing only installed modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Tadeusz Sośnierz committed Aug 16, 2012
1 parent d678433 commit b37c702
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bin/panda
Expand Up @@ -2,7 +2,7 @@
use Shell::Command;
use Panda;

sub listprojects($panda) {
sub listprojects($panda, :$installed) {
for $panda.ecosystem.project-list.sort -> $p {
my $x = $panda.ecosystem.get-project($p);
my $s;
Expand All @@ -11,6 +11,7 @@ sub listprojects($panda) {
when 'installed-dep' { $s = '[installed as a dependency]' }
default { $s = '' }
}
next if $installed and $s eq '';
printf "%-20s\t%s\n", $x.name, $s;
}
}
Expand Down Expand Up @@ -90,8 +91,8 @@ multi MAIN ('install', *@modules, Bool :$notests, Bool :$nodeps) {
}

#= List all available modules
multi MAIN ('list') {
listprojects($panda);
multi MAIN ('list', Bool :$installed) {
listprojects($panda, :$installed);
}

#= Update the module database
Expand Down

0 comments on commit b37c702

Please sign in to comment.