mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-20 02:49:49 +01:00
Use more elegant Perlish method to print supported languages
This commit is contained in:
parent
a41906d323
commit
a0f0249c8f
@ -17,13 +17,7 @@ eval {
|
|||||||
my @languages = glob 'languages/*.pm';
|
my @languages = glob 'languages/*.pm';
|
||||||
my $comma = '';
|
my $comma = '';
|
||||||
print "Supported languages are: ";
|
print "Supported languages are: ";
|
||||||
foreach my $lang (sort @languages) {
|
print join(", ", grep { $_ = basename $_; $_ =~ s/.pm$//; $_ !~ m/^_/ } sort @languages);
|
||||||
$lang = basename($lang);
|
|
||||||
next if $lang =~ m/^_|~$/g;
|
|
||||||
$lang =~ s/\.pm$//;
|
|
||||||
print "$comma$lang";
|
|
||||||
$comma = ', ';
|
|
||||||
}
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user