Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Add section about the new \pager command #420

Merged
merged 3 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": 1,
"label": "docs build",
"message": "2.1.0"
"message": "2.1.1"
}
11 changes: 7 additions & 4 deletions docs/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ Every command starts with a ``\`` character.
| | |
| | ``TYPE`` can be one of the following: |
| | |
| | - not set (query for failing cluster and node |
| | checks) |
| | - ``nodes`` (query for failing node checks) |
| | - ``cluster`` (query for failing cluster checks) |
| | - not set (query for failing cluster and node |
| | checks) |
| | - ``nodes`` (query for failing node checks) |
| | - ``cluster`` (query for failing cluster checks) |
+------------------------+-----------------------------------------------------+
| ``\pager`` | Use apps like ``jless`` or ``pspg`` to |
| | view the result sets. See also :ref:`use-pager`. |
+------------------------+-----------------------------------------------------+
| ``\r <FILENAME>`` | Reads statements from ``<FILENAME>`` and execute |
| | them. |
Expand Down
25 changes: 25 additions & 0 deletions docs/run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This document covers the basics of running Crash from the `command-line`_.

.. contents::
:local:
:depth: 1

Command-line options
====================
Expand Down Expand Up @@ -237,10 +238,34 @@ In both instances:
- ``<DURATION>`` is the total number of seconds the query took to execute on the
cluster


.. _use-pager:

Using a pager program
=====================

You can use applications like the `jless`_ JSON exploration tool or the
`pspg`_ pager program to view the result sets, by utilizing the ``\pager``
command.

.. figure:: https://github.com/crate/crash/assets/38700/e7281ca0-4736-4127-9628-16126b5ea67c

Example
-------
Use those instructions to drill down into the results of your query by
exploring it using ``jless``, like outlined within the screencast above::

cr> \pager jless
cr> \format json
cr> SELECT * FROM sys.nodes;


.. _command-line: https://en.wikipedia.org/wiki/Command-line_interface
.. _jless: https://jless.io/
.. _jq: https://stedolan.github.io/jq/
.. _pipe: https://www.wikiwand.com/en/Pipeline_(Unix)
.. _piping: https://www.wikiwand.com/en/Pipeline_(Unix)
.. _pspg: https://github.com/okbob/pspg
.. _redirecting: https://tldp.org/LDP/abs/html/io-redirection.html
.. _STDOUT: https://en.wikipedia.org/wiki/Standard_streams
.. _user configuration directory: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html