Tweak format options docs

This commit is contained in:
Jakub Roztocil 2021-08-24 17:18:45 +02:00
parent dac0d716c1
commit 8618f12fce

View File

@ -1560,16 +1560,17 @@ One of these options can be used to control output processing:
Default for redirected output. Default for redirected output.
==================== ======================================================== ==================== ========================================================
You can control the applied formatting via the `formatting options`_. You can further control the applied formatting via the more granular `format options`_.
Formatting options Format options
------------------ --------------
The ``--format-options`` option allows you to control how the output should be formatted when formatting is applied.
The following options are available: The following options are available:
+-------------------------------+---------------+------------------------------+ +-------------------------------+---------------+------------------------------+
| Option | Default value | Shortcut(s) | | Option | Default value | Shortcuts |
+===============================+===============+==============================+ +===============================+===============+==============================+
| ``headers.sort`` | ``true`` | ``--sorted``, ``--unsorted`` | | ``headers.sort`` | ``true`` | ``--sorted``, ``--unsorted`` |
+-------------------------------+---------------+------------------------------+ +-------------------------------+---------------+------------------------------+
@ -1587,14 +1588,9 @@ sorting, and specify a custom JSON indent size:
$ http --format-options headers.sort:false,json.sort_keys:false,json.indent:2 pie.dev/get $ http --format-options headers.sort:false,json.sort_keys:false,json.indent:2 pie.dev/get
There are also shortcuts that allow you to quickly disable and re-enable options. There are also two shortcuts that allow you to quickly disable and re-enable
For example, ``--sorted`` and ``--unsorted`` arguments would respectively enable sorting-related format options (currently it means JSON keys and headers):
and disable sorting-related format options: ``--unsorted`` and ``--sorted``.
.. code-block:: bash
$ http --sorted pie.dev/get
$ http --unsorted pie.dev/get
This is something you will typically store as one of the default options in your `config`_ file. This is something you will typically store as one of the default options in your `config`_ file.