From 55e947d7901c17dbb1365a5cfb9f40acd50e903b Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 5 Jan 2019 10:38:38 -0200 Subject: Print CLI errors using Term::ANSIColor. --- website | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'website') diff --git a/website b/website index 9d6c648..42c357e 100755 --- a/website +++ b/website @@ -37,6 +37,7 @@ use warnings; use Getopt::Long qw(:config no_ignore_case bundling pass_through); use Pod::Usage qw(pod2usage); use File::Basename qw(dirname); +use Term::ANSIColor; my $help = 0; my $title = ''; @@ -47,7 +48,7 @@ sub getopts { } sub test { - die "FIXME"; + print colored("FIXME", "red"), "\n"; } sub escaped_cmd { @@ -68,10 +69,10 @@ sub dispatch { -exitval => 0 ); } elsif (!defined $action) { - print "Missing subcommand.\n"; pod2usage( -verbose => 1, - -exitval => 2 + -exitval => 2, + -message => colored("Missing subcommand.", "red") ); } elsif ($action eq 'pastebin') { my @sub_args = grep { $_ ne $action } @args; @@ -82,10 +83,10 @@ sub dispatch { } elsif ($action eq 'test') { test(); } else { - print "Unknown subcommand: $action.\n"; pod2usage( -verbose => 1, - -exitval => 2 + -exitval => 2, + -message => colored("Unknown subcommand: $action.", "red") ); } } -- cgit v1.2.3