]> git.nbdom.net Git - nb.git/commitdiff
delete option --all-effect and process it with option --all
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 20 Apr 2023 01:01:38 +0000 (03:01 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 20 Apr 2023 01:01:38 +0000 (03:01 +0200)
bin/color.pl

index 28796341ffc81cead68a4811684057d9e3c66fad..d8b3b226e0391120b9750f513a0c0538d885daef 100755 (executable)
@@ -12,46 +12,46 @@ my $VERSION = '0.0.2';
 ###############################################################################
 my ($NAME) = $0 =~ m#([^/]+)$#;
 my %BG = (
-       'black'         => 40,
-       'red'                   => 41,
-       'green'         => 42,
-       'yellow'                => 43,
-       'blue'          => 44,
-       'magenta'       => 45,
-       'cyan'          => 46,
-       'white'         => 47,
-       'default'       => 49,
+       'black'   => 40,
+       'red'     => 41,
+       'green'   => 42,
+       'yellow'  => 43,
+       'blue'    => 44,
+       'magenta' => 45,
+       'cyan'    => 46,
+       'white'   => 47,
+       'default' => 49,
 );
 
 my %FG = (
-       'black'         => 30,
-       'red'                   => 31,
-       'green'         => 32,
-       'yellow'                => 33,
-       'blue'          => 34,
-       'magenta'       => 35,
-       'cyan'          => 36,
-       'white'         => 37,
-       'default'       => 39,
+       'black'   => 30,
+       'red'     => 31,
+       'green'   => 32,
+       'yellow'  => 33,
+       'blue'    => 34,
+       'magenta' => 35,
+       'cyan'    => 36,
+       'white'   => 37,
+       'default' => 39,
 );
 
 my %EFFECT = (
-       'none'                          => 0,
-       'bold'                          => 1,
-       'pale'                          => 2,
-       'evidence'                      => 3,
-       'underline'             => 4,
-       'blink'                         => 5,
-       'invert'                                => 7,
-       'cache'                         => 8,
-       'normal'                                => 22,
-       'no_evidence'           => 23,
-       'no_souligne'           => 24,
-       'no_underline'          => 24,
-       'no_clignotant' => 25,
-       'no_blink'                      => 25,
-       'no_inverse'            => 27,
-       'no_invert'                     => 27,
+       'none'          => 0, 
+       'bold'          => 1, 
+       'pale'          => 2, 
+       'evidence'      => 3, 
+       'underline'     => 4, 
+       'blink'         => 5, 
+       'invert'        => 7, 
+       'cache'         => 8, 
+       'normal'        => 22,
+       'no_evidence'   => 23,
+       'no_souligne'   => 24,
+       'no_underline'  => 24,
+       'no_clignotant' => 25,
+       'no_blink'      => 25,
+       'no_inverse'    => 27,
+       'no_invert'     => 27,
 );
 ###############################################################################
 #                        V A L E U R  P A R  D E F A U T 
@@ -77,7 +77,6 @@ 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'};
@@ -97,7 +96,19 @@ if ($Opt{all}) {
 
   my $length = length($input)+3;
 
-  print "Forgrounds:\n";
+  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";
+  }
+
+  print "\nForgrounds:\n";
   for my $fg (sort keys %FG) {
     my $fg_num = $FG{$fg};
 
@@ -128,25 +139,6 @@ 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,