NAME

diffwc - diff + /w/ord highlighting + /c/olor

VERSION

This document describes version 0.007 of diffwc (from Perl distribution App-diffwc), released on 2021-07-08.

SYNOPSIS

Use as you would use diff (the coloring and word highlighting currently will only be shown if you use the unified format):

% diffwc -u file1 file2
% diffwc -ruN My-Dist-0.001 My-Dist-0.002

To alias diff to diffwc, in your shell startup file:

alias diff=diffwc

Sample screenshot (using the Firenze color scheme):

DESCRIPTION

This is a wrapper for the GNU command-line utility diff. It adds word highlighting and colors (note that GNU diff 3.4 or later supports --color already).

COMPLETION

This script has shell tab completion capability with support for several shells.

bash

To activate bash completion for this script, put:

complete -C diffwc diffwc

in your bash startup (e.g. ~/.bashrc). Your next shell session will then recognize tab completion for the command. Or, you can also directly execute the line above in your shell to activate immediately.

It is recommended, however, that you install modules using cpanm-shcompgen which can activate shell completion for scripts immediately.

tcsh

To activate tcsh completion for this script, put:

complete diffwc 'p/*/`diffwc`/'

in your tcsh startup (e.g. ~/.tcshrc). Your next shell session will then recognize tab completion for the command. Or, you can also directly execute the line above in your shell to activate immediately.

It is also recommended to install shcompgen (see above).

other shells

For fish and zsh, install shcompgen as described above.

ENVIRONMENT

COLOR

Boolean.

DIFFWC_COLOR_THEME

String. Will search color themes in ColorTheme::App::diffwc::* modules.

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/App-diffwc.

SOURCE

Source repository is at https://github.com/perlancar/perl-App-diffwc.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-diffwc

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

https://github.com/walles/riff, a Ruby-based utility by which this utility is inspired. riff is more git-oriented: it uses the same color scheme from git while diffwc comes with its own color schemes. riff comes only as a filter, while this package offers a diff wrapper (diffwc) as well as filter (diffwc-filter-u). riff currently has problems dealing with non-unified outputs or multiline word highlighting, and also it does not feel like a typical Unix utility to me (no manpages, for example), so I made diffwc instead.

diffwc-filter-u from the same package, in the form of diff output filter.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2021, 2020, 2018, 2017 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.