App-sdif
view release on metacpan or search on metacpan
script/cdif view on Meta::CPAN
this label. Effect C<D> (double-struck) is exception (See
L<Getopt::EX::Colormap/~>).
=end comment
B<sdif> command also supports B<--visible> option for horizontal tab
with better visibility.
=begin deprecated
=item B<-->[B<no->]B<visible-cr>
=item B<-->[B<no->]B<visible-esc>
Set CARRIAGE-RETURN and ESCAPE visible attributes. These options will
be deprecated soon. Use B<--visible> option instead.
=end deprecated
=item B<--stat>
Print statistical information at the end of output. It shows number
of total appended/deleted/changed words in the context of cdif. It's
common to have many insertions and deletions of newlines because of
text filling process. So normal information is followed by modified
number which ignores insert/delete newlines.
=item B<-->[B<no->]B<lenience>
Suppress warning message for unexpected input from diff command. True
by default.
=item B<--limit> I<key>=I<value>
Set resource limits. Available keys are:
=over 4
=item B<length>=I<#>
Skip word comparison for lines longer than I<#> characters. Default
is 1000. Extremely long lines, such as those found in SVG data, can
make word-level diff processing very slow with no useful result. When
this limit is exceeded, the section is still displayed with basic
colorization but without fine-grained word highlighting. Set to 0 to
disable this limit.
=back
=item B<--linebyline>, B<--lxl>
=item B<--style>=I<style>
Compare input data line-by-line. Consider the inputs as pairs of two
lines each, and output the result of comparing each two lines.
Suppose you have a document with old and new text on lines beginning
with L<OLD:> and L<NEW:> labels.
OLD: this is old text
NEW: and this is updated document
Only this old/new part can be compared using B<greple>'s B<-Mtee>
module as follows.
greple -Mtee cdif --lxl -- --cm=N -GE '^OLD: (.*\n)^NEW: (.*\n)'
B<-Mtee> module sends matched parts to the filter command and replace
them by its result. Consult L<App::Greple::tee> for detail.
You can use L<teip(1)> command as well.
teip -g '^(OLD|NEW):' -- cdif --lxl
If the C<--style=diff> option is given, the two strings are output in
B<diff> format and can be used in combination with the C<sdif> command as
follows.
cdif --lxl --style=diff ... | sdif --no-cdif
Currently the only valid value for C<--style> is C<diff>, which
affects only the behavior of C<--lxl> option.
=back
=head1 GIT
See `perldoc App::sdif` how to use related commands under the GIT
environment.
=head1 ENVIRONMENT
=over 7
=item B<CDIFOPTS>
Environment variable B<CDIFOPTS> is used to set default options.
=item B<LESS>
=item B<LESSANSIENDCHARS>
Since B<cdif> produces ANSI Erase Line terminal sequence, it is
convenient to set B<less> command understand them.
LESS=-cR
LESSANSIENDCHARS=mK
=back
=head1 AUTHOR
Kazumasa Utashiro
=head1 LICENSE
Copyright 1992-2026 Kazumasa Utashiro
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
( run in 0.952 second using v1.01-cache-2.11-cpan-39bf76dae61 )