—#!/usr/bin/env perl
require
App::NDTools::NDDiff;
App::NDTools::NDDiff->new(
@ARGV
)->
exec
();
__END__
=head1 NAME
nddiff - diff tool for nested data structures
=head1 SYNOPSIS
nddiff [OPTIONS] <file1> <file2> [<file3> ... ]
=head1 DESCRIPTION
Diff for nested data structures with human friendly and machine-readable
output formats.
=head1 OPTIONS
=over 4
=item B<--[no]X>
Where X is an op tag: C<A> (added), C<N> (new value), C<O> (old value), C<R>
(removed) or C<U> (unchanged). All ops enabled by default, except C<U>. See
L<Struct::Diff/DIFF FORMAT> for more info about nested diff format.
Ignored when C<--ofmt JSONMERGEPATCH> used.
=item B<--brief>
Show where differences occured, but don't show what exactly changed.
=item B<--[no]colors>
On/Off colors for diff.
=item B<--ctx-text> E<lt>intE<gt>
Amount of lines for multiline values context. Default is 3.
=item B<--grep> E<lt>pathE<gt>
Grep substructures to diff. See path syntax description at
=item B<--help|-h>
Print a help message and exit.
=item B<--ifmt> E<lt>JSON|YAMLE<gt>
Force specified input format usage. Will be selected automatically (using
file name extension) if omitted. L<YAML::XS> should be installed for YAML
support.
=item B<--ignore> E<lt>pathE<gt>
Ignore substructure. May be used several times.
=item B<--json>
Use JSON as output diff format. It's just a shortcut for C<--ofmt JSON>.
=item B<--ofmt> E<lt>JSON|JSONMERGEPATCH|JSONPATCH|RULES|TERM|YAMLE<gt>
Force specified output format usage.
=over 8
=item JSON
JSON serialized L<Nested-Diff|https://github.com/mr-mixas/Nested-Diff>
=item JSONMERGEPATCH
JSON Merge Patch L<rfc7396|https://tools.ietf.org/html/rfc7396>
=item JSONPATCH
JSON Patch L<rfc6902|https://tools.ietf.org/html/rfc6902>
=item RULES
JSON serialized rules for L<ndproc>.
=item TERM
Human friendly, colored terminal diff. Used by default.
=item YAML
YAML serialized L<Nested-Diff|https://github.com/mr-mixas/Nested-Diff>.
L<YAML::XS> should be installed for YAML support, see
L<App::NDTools/LIMITATIONS> for more info.
=back
=item B<--[no]pretty>
On/Off pretty-print for JSON serialized and TERM formats. Full headers will be
printed in TERM mode if disabled. Enabled by default.
=item B<--quiet|-q>
Don't show diff, only exit code shows exists diff or not.
=item B<--rules>
Dump diff as rules for L<ndproc>. B<Deprecated and will be removed
soon>. C<--ofmt rules> should be used instead.
=item B<--show> E<lt>fileE<gt>
Visualize JSON/YAML formatted
L<Nested Diff|https://github.com/mr-mixas/Nested-Diff>.
=item B<--verbose|-v> [int]
Increase verbosity, max level is 4.
=item B<--version|-V>
Print version and exit.
=back
=head1 EXAMPLES
Human-friendly diff:
nddiff a.json b.json
Machine-readable diff:
nddiff --json a.json b.json
Same as above, but without added items:
nddiff --noA --json a.json b.json
=head1 EXIT STATUS
0 No errors, no diff.
1 Generic error code.
2 I/O Error.
4 Path related errors.
8 Difference found.
=head1 BUGS
Report bugs to L<https://github.com/mr-mixas/NDTools/issues>
=head1 SEE ALSO
L<ndpatch>, L<ndproc>, L<ndquery>
L<App::NDTools::NDDiff>, L<Struct::Diff>
=head1 LICENSE AND COPYRIGHT
Copyright 2016-2019 Michael Samoglyadov C<< <mixas at cpan.org> >>.
This program is free software; you can redistribute it and/or modify it
under the terms of GNU General Public License 3 or later versions.