NAME

nddiff - diff tool for nested data structures

SYNOPSIS

nddiff [OPTIONS] <file1> <file2> [<file3> ... ]

DESCRIPTION

Diff for nested data structures with human friendly and machine-readable output formats.

OPTIONS

--[no]X

Where X is an op tag: A (added), N (new value), O (old value), R (removed) or U (unchanged). All ops enabled by default, except U. See "DIFF FORMAT" in Struct::Diff for more info about nested diff format.

Ignored when --ofmt JSONMERGEPATCH used.

--brief

Show where differences occured, but don't show what exactly changed.

--[no]colors

On/Off colors for diff.

--ctx-text <int>

Amount of lines for multiline values context. Default is 3.

--grep <path>

Grep substructures to diff. See path syntax description at https://metacpan.org/pod/Struct::Path::PerlStyle

--help|-h

Print a help message and exit.

--ifmt <JSON|YAML>

Force specified input format usage. Will be selected automatically (using file name extension) if omitted. YAML::XS should be installed for YAML support.

--ignore <path>

Ignore substructure. May be used several times.

--json

Use JSON as output diff format. It's just a shortcut for --ofmt JSON.

--ofmt <JSON|JSONMERGEPATCH|JSONPATCH|RULES|TERM|YAML>

Force specified output format usage.

JSON

JSON serialized Nested-Diff

JSONMERGEPATCH

JSON Merge Patch rfc7396

JSONPATCH

JSON Patch rfc6902

RULES

JSON serialized rules for ndproc.

TERM

Human friendly, colored terminal diff. Used by default.

YAML

YAML serialized Nested-Diff. YAML::XS should be installed for YAML support, see "LIMITATIONS" in App::NDTools for more info.

--[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.

--quiet|-q

Don't show diff, only exit code shows exists diff or not.

--rules

Dump diff as rules for ndproc. Deprecated and will be removed soon. --ofmt rules should be used instead.

--show <file>

Visualize JSON/YAML formatted Nested Diff.

--verbose|-v [int]

Increase verbosity, max level is 4.

--version|-V

Print version and exit.

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

EXIT STATUS

0   No errors, no diff.
1   Generic error code.
2   I/O Error.
4   Path related errors.
8   Difference found.

BUGS

Report bugs to https://github.com/mr-mixas/NDTools/issues

SEE ALSO

ndpatch, ndproc, ndquery

App::NDTools::NDDiff, Struct::Diff

LICENSE AND COPYRIGHT

Copyright 2016-2019 Michael Samoglyadov <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.