From 32b26c5ce133c3d3d28260f7593390bcd5692e84 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 14 Nov 2022 16:50:44 +0100 Subject: [PATCH] swap -C to enable color, -M to disable 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. --- barcat | 10 +++++----- ..._-c_-C_1.out => t1721-option_overrides_-C_-M_1.out} | 0 ...ptions_-M_1_-l_2_hi_3_--st_4_--_5_-1_--version.out} | 0 ...--header.out => t1901-technicolor_-Cs_--header.out} | 0 ...ength=7_--minval=1.1_--maxval=1.11_-L10-30_-Cs.out} | 0 ...out => t1920-colorwave_uncolored_-C_--palette=.out} | 0 ...out => t1921-colorwave_unicolor_-C_--palette=1.out} | 0 ... => t1922-colorwave_duocolor_-C_--palette=40,0.out} | 0 ... t1923-colorwave_tricolor_-C_--palette=41,0,42.out} | 0 ...ave_custom_palette_-C_--palette=31,41,43,42,32.out} | 0 ....out => t1931-colorwave_fire_-C_--palette=fire.out} | 0 ...t1932-colorwave_fireworks_-C_--palette=fire256.out} | 0 ...t => t1933-lolcat_-C_--spark_--palette=rainbow.out} | 0 ...-spark_--indicators=012345_-Cs_--maxval=1_-L17.out} | 0 14 files changed, 5 insertions(+), 5 deletions(-) rename t/{t1721-option_overrides_-c_-C_1.out => t1721-option_overrides_-C_-M_1.out} (100%) rename t/{t1722-mixed_options_-C_1_-l_2_hi_3_--st_4_--_5_-1_--version.out => t1722-mixed_options_-M_1_-l_2_hi_3_--st_4_--_5_-1_--version.out} (100%) rename t/{t1901-technicolor_-cs_--header.out => t1901-technicolor_-Cs_--header.out} (100%) rename t/{t1912-currency_part_-f,_--value-length=7_--minval=1.1_--maxval=1.11_-L10-30_-cs.out => t1912-currency_part_-f,_--value-length=7_--minval=1.1_--maxval=1.11_-L10-30_-Cs.out} (100%) rename t/{t1920-colorwave_uncolored_-c_--palette=.out => t1920-colorwave_uncolored_-C_--palette=.out} (100%) rename t/{t1921-colorwave_unicolor_-c_--palette=1.out => t1921-colorwave_unicolor_-C_--palette=1.out} (100%) rename t/{t1922-colorwave_duocolor_-c_--palette=40,0.out => t1922-colorwave_duocolor_-C_--palette=40,0.out} (100%) rename t/{t1923-colorwave_tricolor_-c_--palette=41,0,42.out => t1923-colorwave_tricolor_-C_--palette=41,0,42.out} (100%) rename t/{t1924-colorwave_custom_palette_-c_--palette=31,41,43,42,32.out => t1924-colorwave_custom_palette_-C_--palette=31,41,43,42,32.out} (100%) rename t/{t1931-colorwave_fire_-c_--palette=fire.out => t1931-colorwave_fire_-C_--palette=fire.out} (100%) rename t/{t1932-colorwave_fireworks_-c_--palette=fire256.out => t1932-colorwave_fireworks_-C_--palette=fire256.out} (100%) rename t/{t1933-lolcat_-c_--spark_--palette=rainbow.out => t1933-lolcat_-C_--spark_--palette=rainbow.out} (100%) rename t/{t2180-spark_combined_--spark_--indicators=012345_-cs_--maxval=1_-L17.out => t2180-spark_combined_--spark_--indicators=012345_-Cs_--maxval=1_-L17.out} (100%) diff --git a/barcat b/barcat index 6ab610d..c029225 100755 --- 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 environment variable. =item -f, --field=( | ) diff --git a/t/t1721-option_overrides_-c_-C_1.out b/t/t1721-option_overrides_-C_-M_1.out similarity index 100% rename from t/t1721-option_overrides_-c_-C_1.out rename to t/t1721-option_overrides_-C_-M_1.out diff --git a/t/t1722-mixed_options_-C_1_-l_2_hi_3_--st_4_--_5_-1_--version.out b/t/t1722-mixed_options_-M_1_-l_2_hi_3_--st_4_--_5_-1_--version.out similarity index 100% rename from t/t1722-mixed_options_-C_1_-l_2_hi_3_--st_4_--_5_-1_--version.out rename to t/t1722-mixed_options_-M_1_-l_2_hi_3_--st_4_--_5_-1_--version.out diff --git a/t/t1901-technicolor_-cs_--header.out b/t/t1901-technicolor_-Cs_--header.out similarity index 100% rename from t/t1901-technicolor_-cs_--header.out rename to t/t1901-technicolor_-Cs_--header.out diff --git a/t/t1912-currency_part_-f,_--value-length=7_--minval=1.1_--maxval=1.11_-L10-30_-cs.out b/t/t1912-currency_part_-f,_--value-length=7_--minval=1.1_--maxval=1.11_-L10-30_-Cs.out similarity index 100% rename from t/t1912-currency_part_-f,_--value-length=7_--minval=1.1_--maxval=1.11_-L10-30_-cs.out rename to t/t1912-currency_part_-f,_--value-length=7_--minval=1.1_--maxval=1.11_-L10-30_-Cs.out diff --git a/t/t1920-colorwave_uncolored_-c_--palette=.out b/t/t1920-colorwave_uncolored_-C_--palette=.out similarity index 100% rename from t/t1920-colorwave_uncolored_-c_--palette=.out rename to t/t1920-colorwave_uncolored_-C_--palette=.out diff --git a/t/t1921-colorwave_unicolor_-c_--palette=1.out b/t/t1921-colorwave_unicolor_-C_--palette=1.out similarity index 100% rename from t/t1921-colorwave_unicolor_-c_--palette=1.out rename to t/t1921-colorwave_unicolor_-C_--palette=1.out diff --git a/t/t1922-colorwave_duocolor_-c_--palette=40,0.out b/t/t1922-colorwave_duocolor_-C_--palette=40,0.out similarity index 100% rename from t/t1922-colorwave_duocolor_-c_--palette=40,0.out rename to t/t1922-colorwave_duocolor_-C_--palette=40,0.out diff --git a/t/t1923-colorwave_tricolor_-c_--palette=41,0,42.out b/t/t1923-colorwave_tricolor_-C_--palette=41,0,42.out similarity index 100% rename from t/t1923-colorwave_tricolor_-c_--palette=41,0,42.out rename to t/t1923-colorwave_tricolor_-C_--palette=41,0,42.out diff --git a/t/t1924-colorwave_custom_palette_-c_--palette=31,41,43,42,32.out b/t/t1924-colorwave_custom_palette_-C_--palette=31,41,43,42,32.out similarity index 100% rename from t/t1924-colorwave_custom_palette_-c_--palette=31,41,43,42,32.out rename to t/t1924-colorwave_custom_palette_-C_--palette=31,41,43,42,32.out diff --git a/t/t1931-colorwave_fire_-c_--palette=fire.out b/t/t1931-colorwave_fire_-C_--palette=fire.out similarity index 100% rename from t/t1931-colorwave_fire_-c_--palette=fire.out rename to t/t1931-colorwave_fire_-C_--palette=fire.out diff --git a/t/t1932-colorwave_fireworks_-c_--palette=fire256.out b/t/t1932-colorwave_fireworks_-C_--palette=fire256.out similarity index 100% rename from t/t1932-colorwave_fireworks_-c_--palette=fire256.out rename to t/t1932-colorwave_fireworks_-C_--palette=fire256.out diff --git a/t/t1933-lolcat_-c_--spark_--palette=rainbow.out b/t/t1933-lolcat_-C_--spark_--palette=rainbow.out similarity index 100% rename from t/t1933-lolcat_-c_--spark_--palette=rainbow.out rename to t/t1933-lolcat_-C_--spark_--palette=rainbow.out diff --git a/t/t2180-spark_combined_--spark_--indicators=012345_-cs_--maxval=1_-L17.out b/t/t2180-spark_combined_--spark_--indicators=012345_-Cs_--maxval=1_-L17.out similarity index 100% rename from t/t2180-spark_combined_--spark_--indicators=012345_-cs_--maxval=1_-L17.out rename to t/t2180-spark_combined_--spark_--indicators=012345_-Cs_--maxval=1_-L17.out -- 2.30.0