]> git.nbdom.net Git - nb.git/commitdiff
option --all-effect
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 20 Apr 2023 00:40:38 +0000 (02:40 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 20 Apr 2023 00:40:38 +0000 (02:40 +0200)
bin/color.pl

index 053ca6121e18c7cb9a02f7346f63ba8f492ef0b9..28796341ffc81cead68a4811684057d9e3c66fad 100755 (executable)
@@ -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