swap -C to enable color, -M to disable
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 14 Nov 2022 15:50:44 +0000 (16:50 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 18 Nov 2022 00:25:46 +0000 (01:25 +0100)
Inconsistent in other programs, but lets copy somewhat related `jq` instead.
Afaict mostly `watch` has -c, and that's for input interpretation.
Frees lowercase c for Count or Column.

14 files changed:
barcat
t/t1721-option_overrides_-C_-M_1.out [moved from t/t1721-option_overrides_-c_-C_1.out with 100% similarity]
t/t1722-mixed_options_-M_1_-l_2_hi_3_--st_4_--_5_-1_--version.out [moved from t/t1722-mixed_options_-C_1_-l_2_hi_3_--st_4_--_5_-1_--version.out with 100% similarity]
t/t1901-technicolor_-Cs_--header.out [moved from t/t1901-technicolor_-cs_--header.out with 100% similarity]
t/t1912-currency_part_-f,_--value-length=7_--minval=1.1_--maxval=1.11_-L10-30_-Cs.out [moved from t/t1912-currency_part_-f,_--value-length=7_--minval=1.1_--maxval=1.11_-L10-30_-cs.out with 100% similarity]
t/t1920-colorwave_uncolored_-C_--palette=.out [moved from t/t1920-colorwave_uncolored_-c_--palette=.out with 100% similarity]
t/t1921-colorwave_unicolor_-C_--palette=1.out [moved from t/t1921-colorwave_unicolor_-c_--palette=1.out with 100% similarity]
t/t1922-colorwave_duocolor_-C_--palette=40,0.out [moved from t/t1922-colorwave_duocolor_-c_--palette=40,0.out with 100% similarity]
t/t1923-colorwave_tricolor_-C_--palette=41,0,42.out [moved from t/t1923-colorwave_tricolor_-c_--palette=41,0,42.out with 100% similarity]
t/t1924-colorwave_custom_palette_-C_--palette=31,41,43,42,32.out [moved from t/t1924-colorwave_custom_palette_-c_--palette=31,41,43,42,32.out with 100% similarity]
t/t1931-colorwave_fire_-C_--palette=fire.out [moved from t/t1931-colorwave_fire_-c_--palette=fire.out with 100% similarity]
t/t1932-colorwave_fireworks_-C_--palette=fire256.out [moved from t/t1932-colorwave_fireworks_-c_--palette=fire256.out with 100% similarity]
t/t1933-lolcat_-C_--spark_--palette=rainbow.out [moved from t/t1933-lolcat_-c_--spark_--palette=rainbow.out with 100% similarity]
t/t2180-spark_combined_--spark_--indicators=012345_-Cs_--maxval=1_-L17.out [moved from t/t2180-spark_combined_--spark_--indicators=012345_-cs_--maxval=1_-L17.out with 100% similarity]

diff --git a/barcat b/barcat
index 6ab610db6282e26f15996fb88605e96f2a5669ba..c0292257676ade42c1a2b5c7a9d429d092bd92f7 100755 (executable)
--- a/barcat
+++ b/barcat
@@ -14,8 +14,8 @@ require Getopt::Long;
 Getopt::Long->import('2.33', qw( :config gnu_getopt ));
 GetOptions(\%opt,
        'ascii|a!',
-       'color|c!',
-       'C' => sub { $opt{color} = 0 },
+       'color|C!',
+       'M' => sub { $opt{color} = 0 },
        'field|f=s' => sub {
                eval {
                        local $_ = $_[1];
@@ -369,7 +369,7 @@ Usage:                                               /\_/\
                                                     (u   u)
 Options:
   -a, --[no-]ascii         Restrict user interface to ASCII characters
-  -c, --[no-]color         Force colored output of values and bar markers
+  -C, --[no-]color         Force colored output of values and bar markers
   -f, --field=(N|REGEXP)   Compare values after a given number of whitespace
                            separators
       --header             Prepend a chart axis with minimum and maximum
@@ -430,12 +430,12 @@ Restrict user interface to ASCII characters,
 replacing default UTF-8 by their closest approximation.
 Input is always interpreted as UTF-8 and shown as is.
 
-=item -c, --[no-]color
+=item -C, --[no-]color
 
 Force colored output of values and bar markers.
 Defaults on if output is a tty,
 disabled otherwise such as when piped or redirected.
-Can also be disabled by setting I<-C>
+Can also be disabled by setting I<-M>
 or the I<NO_COLOR> environment variable.
 
 =item -f, --field=(<number> | <regexp>)