#!/usr/bin/env perl

require App::NDTools::NDProc;

App::NDTools::NDProc->new(@ARGV)->exec();

__END__

=head1 NAME

ndproc - nested data processor, extendable by modules

=head1 SYNOPSIS

    ndproc [OPTIONS] <arguments>

=head1 DESCRIPTION

Process nested data structures according provided rules

=head1 OPTIONS

=over 4

=item B<--builtin-format> <RAW|JSON|YAML>

Format for builtin rules and blames. Raw structure used by default.

=item B<--builtin-rules> E<lt>pathE<gt>

Use builtin (in processed object) rules.

=item B<--disable-module> E<lt>modnameE<gt>

Skip (don't process) rules for specified module. May be used several times.

=item B<--dump-blame> E<lt>fileE<gt>

Dump blame to file.

=item B<--dump-rules> E<lt>fileE<gt>

Dump rules to file.

=item B<--embed-blame> E<lt>pathE<gt>

Embed blame into processed structure, using provided path.

=item B<--embed-rules> E<lt>pathE<gt>

Embed used rules into processed structure, using provided path.

=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<--list-modules|-l>

List available modules.

=item B<--module|-m> E<lt>nameE<gt>

Process structure using specified module.

=item B<--ofmt> E<lt>JSON|YAMLE<gt>

Force specified output format usage. JSON is used by default; L<YAML::XS>
should be installed for YAML support, see L<App::NDTools/LIMITATIONS> for
more info.

=item B<--rules> E<lt>fileE<gt>

Load rules from specified file. May be used several times.

=item B<--verbose|-v> [int]

Increase verbosity, max level is 4.

=item B<--version|-V>

Print version and exit.

=back

=head1 AVAILABLE MODULES

 Insert           Insert value into structure
 JsonMergePatch   Apply JSON Merge Patch (rfc7396) patches
 JsonPatch        Apply JSON Patch (rfc6902) patches
 Merge            Merge structures according provided rules
 Patch            Apply nested diff to the structure
 Pipe             Modify structure using external process
 Remove           Remove specified parts from structure

=head1 EXAMPLES

Simply merge three files using module C<Merge>:

    ndproc --module Merge a.json --source b.json --source c.json

Print usage for C<Merge> module:

    ndproc --module Merge --help

=head1 EXIT STATUS

 0   No errors occured.
 1   Generic error code.
 2   I/O Error.
 4   Path related errors.

=head1 BUGS

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

=head1 SEE ALSO

L<nddiff>, L<ndpatch>, L<ndquery>

L<App::NDTools::NDProc>

=head1 LICENSE AND COPYRIGHT

Copyright 2016-2018 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.
