On Fri, Oct 04, 2019 at 01:44:10PM +0200, Klemens Nanni wrote:
> rsadowski noted that DESCR is too lenghty and upon second read I agree
> that my shameless dump of the project's README is too much.
>
> Nonetheless I'd like to provide more information than
>
> yq is a command line processor for Yaml/Xml documents,
> similar to jq for Json.
>
> for the user's convenience, so here's a second attempt that reduces
> DESCR into what I think is still relevant; no other changes in the new
> tarball except a whitespace fix in Makefile.
>
> Information for inst:yq-2.7.2
>
> Comment:
> jq wrapper for YAML/XML documents
>
> Description:
> yq takes YAML input, converts it to JSON, and filters it through jq(1).
>
> No output conversion is done by default. Command line arguments are
> forwarded.
> yq exits 1 on YAML parsing errors, otherwise jq's exit code is forwarded.
>
> YAML tags in the input are ignored (any nested data is treated as untagged).
> Key order is preserved.
>
> xq behaves like yq but takes XML input. Multiple XML documents can be passed
> in separate files/streams. Entity expansion and DTD resolution is disabled to
> avoid XML parsing vulnerabilities.
>
> Maintainer: Klemens Nanni
>
> WWW: https://yq.readthedocs.io/
kmos reported different (failing?) test results but I could not
reproduce any of it; see attached the same tarball again as well as my
test.log.
Feedback?
yq.tgz
Description: Binary data
/usr/local/bin/python3.7 /usr/ports/pobj/yq-2.7.2/yq-2.7.2/test/test.py
.[
"2016-12-20T22:07:36"
]
"2016-12-20"
.{}
..40333
x{}
."bar"
.{
"foo": null
}
..jq - commandline JSON processor [version 1.6]
Usage: jq [options] [file...]
jq [options] --args [strings...]
jq [options] --jsonargs [JSON_TEXTS...]
jq is a tool for processing JSON inputs, applying the given filter to
its JSON text inputs and producing the filter's results as JSON on
standard output.
The simplest filter is ., which copies jq's input to its output
unmodified (except for formatting, but note that IEEE754 is used
for number representation internally, with all that that implies).
For more advanced filters see the jq(1) manpage ("man jq")
and/or https://stedolan.github.io/jq
Example:
$ echo '{"foo": 0}' | jq .
{
"foo": 0
}
Some of the options include:
-c compact instead of pretty-printed output;
-n use `null` as the single input value;
-e set the exit status code based on the output;
-s read (slurp) all inputs into an array; apply filter to it;
-r output raw strings, not JSON texts;
-R read raw strings, not JSON texts;
-C colorize JSON;
-M monochrome (don't colorize JSON);
-S sort keys of objects on output;
--tabuse tabs for indentation;
--arg a vset variable $a to value ;
--argjson a vset variable $a to JSON value ;
--slurpfile a f set variable $a to an array of JSON texts read from ;
--rawfile a fset variable $a to a string consisting of the contents of
;
--args remaining arguments are string arguments, not files;
--jsonargs remaining arguments are JSON arguments, not files;
-- terminates argument processing;
Named arguments are also available as $ARGS.named[], while
positional arguments are available as $ARGS.positional[].
See the manpage for more options.
jq - commandline JSON processor [version 1.6]
Usage: jq [options] [file...]
jq [options] --args [strings...]
jq [options] --jsonargs [JSON_TEXTS...]
jq is a tool for processing JSON inputs, applying the given filter to
its JSON text inputs and producing the filter's results as JSON on
standard output.
The simplest filter is ., which copies jq's input to its output
unmodified (except for formatting, but note that IEEE754 is used
for number representation internally, with all that that implies).
For more advanced filters see the jq(1) manpage ("man jq")
and/or https://stedolan.github.io/jq
Example:
$ echo '{"foo": 0}' | jq .
{
"foo": 0
}
Some of the options include:
-c compact instead of pretty-printed output;
-n use `null` as the single input value;
-e set the exit status code based on the output;
-s read (slurp) all inputs into an array; apply filter to it;
-r output raw strings, not JSON texts;
-R read raw strings, not JSON texts;
-C colorize JSON;
-M monochrome (don't colorize JSON);
-S sort keys of objects on output;
--tabuse tabs for indentation;
--arg a vset variable $a to value ;
--argjson a vset variable $a to JSON value ;
--slurpfile a f set variable $a to an array of JSON texts read from ;
--rawfile a fset variable