From: Nicolas Boisselier Date: Thu, 20 Apr 2023 00:40:38 +0000 (+0200) Subject: option --all-effect X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=20b3bb171609f65ae48e4c8a5f093ed6e1438d57;p=nb.git option --all-effect --- diff --git a/bin/color.pl b/bin/color.pl index 053ca612..28796341 100755 --- a/bin/color.pl +++ b/bin/color.pl @@ -77,6 +77,7 @@ use Getopt::Long qw(:config default no_ignore_case); my %Opt; ,'effect|ef=s' ,'print-num|n!' ,'all|a!' + ,'all-effect|ae!' ) || exit -1; &help() if $Opt{'help'}; &version() if $Opt{'version'}; @@ -95,10 +96,6 @@ my $input = join('',@ARGV) || 'My Text'; if ($Opt{all}) { my $length = length($input)+3; - #use Data::Dumper; die Dumper(\%BG); - #print map { $_ = printf "%-".($length+4)."s |\n", "$_ $BG{$_}" } keys %BG; - #exit 0; -# NB 08.08.14 print map { "$BG{$_}\n" print "Forgrounds:\n"; for my $fg (sort keys %FG) { @@ -131,6 +128,25 @@ if ($Opt{all}) { exit 0; } +if ($Opt{'all-effect'}) { + + my $length = length($input)+3; + + print "\nEffect:\n"; + for my $e (sort keys %EFFECT) { + my $e_num = $EFFECT{$e}; + + printf "%21s", "$e ($e_num) | "; + + print in_color($input,{ + effect => $e, + num => $PRINT_CODE, + }),"\n"; + } + + exit 0; +} + print in_color($input,{ fg => $FG, bg => $BG, @@ -176,6 +192,7 @@ my ($txt,$hparam) = @_; ; } } + sub version { #------------------------------------------------------------------------------ # Affiche la version