diff options
author | Sadie Powell <sadie@witchery.services> | 2020-10-15 17:13:57 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-10-15 17:15:28 +0100 |
commit | 78c79a379af12e8fdf9ea8008f30f7fc18df1f36 (patch) | |
tree | eaf9cf4ed7a05a98b97a3f723a37296b486cc24a /configure | |
parent | ff88faf931e390e30a994b69fff1ce17bf134029 (diff) |
More consistently show modules without the file prefix and suffix.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -353,8 +353,8 @@ Would you like to enable extra modules manually? EOQ if (prompt_bool $interactive, $question, 0) { foreach my $extra (<$RealDir/src/modules/extra/m_*.cpp>) { - my $module_name = basename $extra, '.cpp'; - if (prompt_bool $interactive, "Would you like to enable $module_name?", 0) { + my $module_name = module_shrink $extra; + if (prompt_bool $interactive, "Would you like to enable the <|BOLD $module_name|> module?", 0) { enable_extras $module_name; } } @@ -441,8 +441,7 @@ Configuration is complete! You have chosen to build with the following settings: EOM for my $file (<$RealDir/src/modules/m_*>) { - my $module = basename $file, '.cpp'; - say " * $module" if -l $file; + say " * ${\module_shrink $file}" if -l $file; } my @makeargs; @@ -490,7 +489,7 @@ sub list_extras () { my @sources = map { File::Spec->case_tolerant() ? lc($_) : $_ } (readdir($dd)); closedir $dd; undef $dd; - my $maxlen = (sort { $b <=> $a } (map {length($_)} (@extras)))[0]; + my $maxlen = (sort { $b <=> $a } (map { length module_shrink $_ } (@extras)))[0]; my %extras = (); EXTRA: for my $extra (@extras) { next if (File::Spec->curdir() eq $extra || File::Spec->updir() eq $extra); @@ -558,9 +557,9 @@ EXTRA: for my $extra (@extras) { for my $extra (sort {$a cmp $b} keys(%extras)) { my $text = $extras{$extra}; if ($text =~ m/needed by/ && $text !~ m/enabled/) { - printf "\e[31;1;5m%-*s = %s%s\e[0m\n", $maxlen, $extra, $text, ($text =~ m/needed by/ ? ")" : ""); + printf "\e[31;1;5m%-*s = %s%s\e[0m\n", $maxlen, module_shrink($extra), $text, ($text =~ m/needed by/ ? ")" : ""); } else { - printf "%-*s = %s%s\n", $maxlen, $extra, $text, ($text =~ m/needed by/ ? "\e[0m)" : ""); + printf "%-*s = %s%s\n", $maxlen, module_shrink($extra), $text, ($text =~ m/needed by/ ? "\e[0m)" : ""); } } return keys(%extras) if wantarray; # Can be used by manage_extras. @@ -571,8 +570,8 @@ sub enable_extras(@) { my $extradir = catdir $moduledir, 'extra'; for my $extra (@_) { - my $shortname = $extra =~ s/(?:^m_|\.cpp$)//gr; - my $extrafile = "m_$shortname.cpp"; + my $shortname = module_shrink $extra; + my $extrafile = module_expand $extra; my $extrapath = catfile $extradir, $extrafile; if (!-f $extrapath) { @@ -602,8 +601,8 @@ sub disable_extras(@) { my $extradir = catdir $moduledir, 'extra'; for my $extra (@_) { - my $shortname = $extra =~ s/(?:^m_|\.cpp$)//gr; - my $extrafile = "m_$shortname.cpp"; + my $shortname = module_shrink $extra; + my $extrafile = module_expand $extra; my $modulepath = catfile $moduledir, $extrafile; my $extrapath = catfile $extradir, $extrafile; |