App::DPath - Cmdline tool around Data::DPath
This module provides a cmdline tool around Data::DPath.
Query some input data with a DPath to stdout.
Default data format (in and out) is YAML, other formats can be specified.
$ dpath '//some/dpath' data.yaml
Use it as filter:
$ dpath '//some/dpath' < data.yaml > result.yaml $ cat data.yaml | dpath '//some/dpath' > result.yaml $ cat data.yaml | dpath '//path1' | dpath '//path2' | dpath '//path3'
You can define different input/output formats (yaml, json, xml, ini, dumper, tap, flat) with
See documentation for the dpath utility for more.
dpath tool is based on App::Cmd which is using sub commands. All the above examples use the default subcommand
search which is silently inserted into the argument/options list if no subcommand is given.
So instead of
$ dpath -i json -o dumper data.json
you can also write
$ dpath search -i json -o dumper data.json
Other available subcommands are
The built in help always fully refers to subcommands.
Steffen Schwigon <email@example.com>
This software is copyright (c) 2012 by Steffen Schwigon.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.