diff options
author | Andrey Kislyuk <kislyuk@gmail.com> | 2018-05-19 10:11:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-19 10:11:32 -0700 |
commit | 4053028f986eba2f6147b5b4d98dc43fab1edddf (patch) | |
tree | 90ad419d7bcd9b43b1d0fd1eb8e0f778d0b2565b | |
parent | 090c6e04ab1163252315501a53ea8816d1955ae2 (diff) |
Simplify synopsis
-rw-r--r-- | README.rst | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -13,27 +13,25 @@ Before using ``yq``, you also have to install its dependency, ``jq``. See the `j Synopsis -------- -``yq``'s mode of operation is simple: it transcodes YAML on standard input to JSON (using the key-order-preserving -equivalent of ``yaml.safe_load_all`` to avoid dangerous vulnerabilities in YAML/PyYAML design) and pipes it to -`jq <https://stedolan.github.io/jq/>`_:: +``yq`` takes YAML input, converts it to JSON, and pipes it to `jq <https://stedolan.github.io/jq/>`_:: cat input.yml | yq .foo.bar -Or specify the filename directly:: +Like in ``jq``, you can also specify input filename(s) as arguments:: yq .foo.bar input.yml -By default, no transcoding of ``jq`` output is done. Use the ``--yaml-output``/``-y`` argument to transcode it back -into YAML (using the key-order-preserving equivalent of ``yaml.safe_dump_all``):: +By default, no conversion of ``jq`` output is done. Use the ``--yaml-output``/``-y`` argument to convert it back into YAML:: cat input.yml | yq -y .foo.bar -Use the ``--width``/``-w`` argument to pass the line wrap width for string literals. YAML -`tags <http://www.yaml.org/spec/1.2/spec.html#id2764295>`_ are ignored (any nested data is treated as untagged). +Use the ``--width``/``-w`` argument to pass the line wrap width for string literals. All other command line arguments are +forwarded to ``jq``. ``yq`` forwards the exit code ``jq`` produced, unless there was an error in YAML parsing, in which case +the exit code is 1. See the `jq manual <https://stedolan.github.io/jq/manual/>`_ for more details on ``jq`` features and +options. -All other command line arguments are forwarded to ``jq``. ``yq`` forwards the exit code ``jq`` produced, -unless there was an error in YAML parsing, in which case the exit code is 1. See the `jq manual -<https://stedolan.github.io/jq/manual/>`_ for more details on ``jq`` features and options. +YAML `tags <http://www.yaml.org/spec/1.2/spec.html#id2764295>`_ in the input are ignored (any nested data is treated as +untagged). Key order is preserved. XML support ----------- |