summaryrefslogtreecommitdiff
path: root/make/console.pm
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-01-29 13:39:13 +0000
committerSadie Powell <sadie@witchery.services>2021-01-29 13:39:13 +0000
commit3e557e85d3ae1ef6d09ed2fdda379d8833a4400d (patch)
tree7cb0712740fc1ce9c0ddac1982c46a6a4de0d410 /make/console.pm
parentad1ad11067ab089710305c030b00e966f3f10d17 (diff)
Purge all remaining uses of print_format.
Diffstat (limited to 'make/console.pm')
-rw-r--r--make/console.pm16
1 files changed, 5 insertions, 11 deletions
diff --git a/make/console.pm b/make/console.pm
index 50df77ea5..cd2a780e7 100644
--- a/make/console.pm
+++ b/make/console.pm
@@ -31,7 +31,6 @@ use File::Spec::Functions qw(rel2abs);
our @EXPORT = qw(command
execute_command
console_format
- print_format
print_error
print_warning
prompt_bool
@@ -69,12 +68,6 @@ sub console_format($) {
return $message;
}
-sub print_format($;$) {
- my $message = shift;
- my $stream = shift // *STDOUT;
- print { $stream } console_format $message;
-}
-
sub print_error {
print STDERR console_format "<|RED Error:|> ";
for my $line (@_) {
@@ -120,7 +113,7 @@ sub prompt_string($$$) {
my ($interactive, $question, $default) = @_;
return $default unless $interactive;
say console_format $question;
- say console_format "[<|GREEN $default|>] => ";
+ print console_format "[<|GREEN $default|>] => ";
chomp(my $answer = <STDIN>);
say '';
return $answer ? $answer : $default;
@@ -143,13 +136,14 @@ sub command_alias($$) {
sub execute_command(@) {
my $command = defined $_[0] ? lc shift : 'help';
if ($command eq 'help') {
- print_format "<|GREEN Usage:|> $0 <<|UNDERLINE COMMAND|>> [<|UNDERLINE OPTIONS...|>]\n\n";
- print_format "<|GREEN Commands:|>\n";
+ say console_format "<|GREEN Usage:|> $0 <<|UNDERLINE COMMAND|>> [<|UNDERLINE OPTIONS...|>]";
+ say '';
+ say console_format "<|GREEN Commands:|>";
for my $key (sort keys %commands) {
next unless defined $commands{$key}->description;
my $name = sprintf "%-15s", $key;
my $description = $commands{$key}->description;
- print_format " <|BOLD $name|> # $description\n";
+ say console_format " <|BOLD $name|> # $description";
}
exit 0;
} elsif (!$commands{$command}) {