App-ccdiff
view release on metacpan or search on metacpan
"$home/.ccdiffrc",
"$home/.config/ccdiff",
) {
-s $rcf or next;
(stat $rcf)[2] & 022 and next;
open my $fh, "<", $rcf or next;
while (<$fh>) {
my ($k, $v) = (m/^\s*([-\w]+)\s*[:=]\s*(.*\S)/) or next;
$rc{ lc $k
=~ s{[-_]colou?r$}{}ir
=~ s{background}{bg}ir
=~ s{^(?:unicode|utf-?8?)$}{utf8}ir
} = $v
=~ s{U\+?([0-9A-Fa-f]{2,7})}{chr hex $1}ger
=~ s{^(?:no|false)$}{0}ir
=~ s{^(?:yes|true)$}{-1}ir; # -1 is still true
}
}
} # read_rc
# Return the known colors from Term::ANSIColor
ARROW BELOW), but as most terminals are probably unable to show it due to line
height changes, I did not pursue the idea.
=item --pink -p
Change the default C<red> for deleted text to the color closest to pink that
is supported by L<Term::ANSIColor>: C<magenta>.
=item --reverse -r
Reverse/invert the foreground and background for the colored indicators.
If the foreground color has C<bold>, it will be stripped from the new background
color.
=item --swap -s
Swap the colors for new and old.
=item --list-colors
List available colors and exit.
=item --old=color
Define the foreground color for deleted text.
=item --new=color
Define the foreground color for added text.
=item --bg=color
Define the background color for changed text.
=item --index --idx -I
Prefix position indicators with an index.
[001] 5,5c5,5
-Sat Dec 18 07:08:33 1998,I.O.D.U.,,756194433,1442539
+Sat Dec 18 07:00:33 1993,I.O.D.U.,,756194433,1442539
If a positive number is passed (C<--index=4> or C<-I 4>), display just the
ascii : false
Defines to use ASCII markers instead of Unicode markers. The default is to use
Unicode markers.
=item reverse (-r)
reverse : false
Defines if changes are displayed as foreground-color over background-color
or background-color over foreground-color. The default is C<false>, so it will
color the changes with the appropriate color (C<new> or C<old>) over the
default background color.
=item swap (-s)
swap : false
Swap the colors for new and old.
=item new (--new)
new : green
old-color
old_color
old-colour
old_colour
=item bg (--bg)
bg : white
Defines the color to be used as background for changed text. The default is
C<white>.
The color C<none> is also accepted and disables this color.
Any color accepted by L<Term::ANSIColor> is allowed. Any other color will
result in a warning. The C<bold> attribute is not allowed.
This option may also be specified as
bg-color
bg_color
bg-colour
bg_colour
background
background-color
background_color
background-colour
background_colour
=item header (-H --header --HC=color --header-color=color)
header : 1
header : blue_on_white
Defines if a header is displayed above the diff (default is 1), supported
colors are allowed.
If the value is a valid supported color, it will show the header in that
lib/App/ccdiff.pm view on Meta::CPAN
"$home/.ccdiffrc",
"$home/.config/ccdiff",
) {
-s $rcf or next;
(stat $rcf)[2] & 022 and next;
open my $fh, "<", $rcf or next;
while (<$fh>) {
my ($k, $v) = (m/^\s*([-\w]+)\s*[:=]\s*(.*\S)/) or next;
$rc{ lc $k
=~ s{[-_]colou?r$}{}ir
=~ s{background}{bg}ir
=~ s{^(?:unicode|utf-?8?)$}{utf8}ir
} = $v
=~ s{U\+?([0-9A-Fa-f]{2,7})}{chr hex $1}ger
=~ s{^(?:no|false)$}{0}ir
=~ s{^(?:yes|true)$}{-1}ir; # -1 is still true
}
}
} # read_rc
# Return the known colors from Term::ANSIColor
lib/App/ccdiff.pm view on Meta::CPAN
ARROW BELOW), but as most terminals are probably unable to show it due to line
height changes, I did not pursue the idea.
=item --pink -p
Change the default C<red> for deleted text to the color closest to pink that
is supported by L<Term::ANSIColor>: C<magenta>.
=item --reverse -r
Reverse/invert the foreground and background for the colored indicators.
If the foreground color has C<bold>, it will be stripped from the new background
color.
=item --swap -s
Swap the colors for new and old.
=item --list-colors
List available colors and exit.
lib/App/ccdiff.pm view on Meta::CPAN
=item --old=color
Define the foreground color for deleted text.
=item --new=color
Define the foreground color for added text.
=item --bg=color
Define the background color for changed text.
=item --index --idx -I
Prefix position indicators with an index.
[001] 5,5c5,5
-Sat Dec 18 07:08:33 1998,I.O.D.U.,,756194433,1442539
+Sat Dec 18 07:00:33 1993,I.O.D.U.,,756194433,1442539
If a positive number is passed (C<--index=4> or C<-I 4>), display just the
lib/App/ccdiff.pm view on Meta::CPAN
ascii : false
Defines to use ASCII markers instead of Unicode markers. The default is to use
Unicode markers.
=item reverse (-r)
reverse : false
Defines if changes are displayed as foreground-color over background-color
or background-color over foreground-color. The default is C<false>, so it will
color the changes with the appropriate color (C<new> or C<old>) over the
default background color.
=item swap (-s)
swap : false
Swap the colors for new and old.
=item new (--new)
new : green
lib/App/ccdiff.pm view on Meta::CPAN
old-color
old_color
old-colour
old_colour
=item bg (--bg)
bg : white
Defines the color to be used as background for changed text. The default is
C<white>.
The color C<none> is also accepted and disables this color.
Any color accepted by L<Term::ANSIColor> is allowed. Any other color will
result in a warning. The C<bold> attribute is not allowed.
This option may also be specified as
bg-color
bg_color
bg-colour
bg_colour
background
background-color
background_color
background-colour
background_colour
=item header (-H --header --HC=color --header-color=color)
header : 1
header : blue_on_white
Defines if a header is displayed above the diff (default is 1), supported
colors are allowed.
If the value is a valid supported color, it will show the header in that
( run in 2.024 seconds using v1.01-cache-2.11-cpan-0d23b851a93 )