From 6c1a489a4f71b9d320680b53612f1d76dc826147 Mon Sep 17 00:00:00 2001 From: Kseniia Antonova Date: Thu, 25 Aug 2022 16:33:40 +0300 Subject: [PATCH 1/5] Add table with shortcuts --- doc/reference/interactive_console.rst | 38 ++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/doc/reference/interactive_console.rst b/doc/reference/interactive_console.rst index c2bfb73ac9..310ed9281f 100644 --- a/doc/reference/interactive_console.rst +++ b/doc/reference/interactive_console.rst @@ -12,14 +12,16 @@ or start :ref:`tarantoolctl ` with ``enter``. The interactive console is often called the Lua console to distinguish it from the administrative console, but in fact it can handle both Lua and SQL input. -The majority of examples in this manual show what users see with the -interactive console, including the prompt (which can be ``tarantool>``), -the instruction (which can be a Lua request or an SQL statement), -and the response (which can be a display in either YAML format or Lua format). +The majority of examples in this manual show what users see with the interactive console. +It includes: + +* ``tarantool>`` prompt +* instruction (a Lua request or an SQL statement) +* response (a display in either YAML or Lua format) .. code-block:: none - -- Typical interactive console example with Lua input and YAML output + -- Interactive console example with Lua input and YAML output tarantool> box.info().replication --- - 1: @@ -37,10 +39,13 @@ But a common recommendation is to say ``set delimiter ;`` especially if input is .. _interactive_console_output: +Interactive console output +-------------------------- + The **output format** can be changed to Lua with ``\set output lua`` or changed to YAML (the default) with ``\set output yaml``. -Ordinarily. output from the console has `YAML format `_. +Ordinarily, output from the console has `YAML format `_. That means that there is a line for document-start ``"---"``, and each item begins on a separate line starting with ``"- "``, and each sub-item in a nested structure is indented, @@ -54,7 +59,7 @@ So, when input is a Lua object description, output will equal input. YAML is good for readability. Lua is good for re-using results as requests. -A third format, MsgPack, is good for database storage. +The third format, MsgPack, is good for database storage. Currently the default output format is YAML but it may be Lua in a future version, and it may be Lua if the last :ref:`set_default_output ` @@ -120,3 +125,22 @@ call was ``console.set_default_output('lua')``. | :code:`...` - :code:`\x81 \xa3 \x6b \x65 \x79 \x01` + +.. _interactive_console-keyboard_shortcuts: + +Keyboard shortcuts +------------------ + + .. list-table:: + :widths: 25 75 + :header-rows: 1 + + * - Keyboard shortcut + - Effect + + * - ``CTL+C`` + - Discard current input with the ``SIGINT`` signal in the console mode and + jump to a new line with a default prompt. + + * - ``CTL+D`` + - Quit Tarantool interactive console. \ No newline at end of file From c313893d9bc36e32cb46ed742522b737647915cd Mon Sep 17 00:00:00 2001 From: Kseniia Antonova Date: Thu, 25 Aug 2022 17:25:20 +0300 Subject: [PATCH 2/5] Update header and ref --- doc/reference/interactive_console.rst | 12 ++++++------ doc/reference/reference_lua/console.rst | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/reference/interactive_console.rst b/doc/reference/interactive_console.rst index 310ed9281f..c9e6f83ab8 100644 --- a/doc/reference/interactive_console.rst +++ b/doc/reference/interactive_console.rst @@ -30,6 +30,11 @@ It includes: lsn: 0 ... +.. _interactive_console_input_output: + +Interactive console input and output +------------------------------------ + The **input language** can be changed to SQL with ``\set language sql`` or changed to Lua (the default) with ``\set language lua``. @@ -37,11 +42,6 @@ The **delimiter** can be changed to any character with :samp:`\set delimiter ` section. + :ref:`Interactive console ` section. .. _console-eos: From 81dbe7f0f3b10d8db36e3559c317c3251b6f19ba Mon Sep 17 00:00:00 2001 From: Kseniia Antonova Date: Thu, 25 Aug 2022 18:26:29 +0300 Subject: [PATCH 3/5] fix typo and add admonition --- doc/reference/interactive_console.rst | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/doc/reference/interactive_console.rst b/doc/reference/interactive_console.rst index c9e6f83ab8..686497bf33 100644 --- a/doc/reference/interactive_console.rst +++ b/doc/reference/interactive_console.rst @@ -131,16 +131,21 @@ call was ``console.set_default_output('lua')``. Keyboard shortcuts ------------------ - .. list-table:: - :widths: 25 75 - :header-rows: 1 +.. list-table:: + :widths: 25 75 + :header-rows: 1 + + * - Keyboard shortcut + - Effect + + * - ``CTRL+C`` + - Discard current input with the ``SIGINT`` signal in the console mode and + jump to a new line with a default prompt. - * - Keyboard shortcut - - Effect + * - ``CTRL+D`` + - Quit Tarantool interactive console. - * - ``CTL+C`` - - Discard current input with the ``SIGINT`` signal in the console mode and - jump to a new line with a default prompt. +.. important:: - * - ``CTL+D`` - - Quit Tarantool interactive console. \ No newline at end of file + Keep in mind that ``CTRL+C`` shortcut will shut Tarantool down if there is any currently running command + in the console. \ No newline at end of file From fd707cd214a288dc7bfe64ae9259cd3685555527 Mon Sep 17 00:00:00 2001 From: Kseniia Antonova Date: Thu, 25 Aug 2022 18:56:24 +0300 Subject: [PATCH 4/5] Update admonition --- doc/reference/interactive_console.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/reference/interactive_console.rst b/doc/reference/interactive_console.rst index 686497bf33..e6e6fb20c3 100644 --- a/doc/reference/interactive_console.rst +++ b/doc/reference/interactive_console.rst @@ -148,4 +148,5 @@ Keyboard shortcuts .. important:: Keep in mind that ``CTRL+C`` shortcut will shut Tarantool down if there is any currently running command - in the console. \ No newline at end of file + in the console. + The :ref:`SIGINT ` signal stops the instance running in a daemon mode. \ No newline at end of file From 2b9d820fd75943b4d84b8f7722391fccdcc05ba6 Mon Sep 17 00:00:00 2001 From: Kseniia Antonova Date: Thu, 25 Aug 2022 19:06:04 +0300 Subject: [PATCH 5/5] Add version --- doc/reference/interactive_console.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/reference/interactive_console.rst b/doc/reference/interactive_console.rst index e6e6fb20c3..060dc22d19 100644 --- a/doc/reference/interactive_console.rst +++ b/doc/reference/interactive_console.rst @@ -131,6 +131,8 @@ call was ``console.set_default_output('lua')``. Keyboard shortcuts ------------------ +Since :doc:`2.10.0 `. + .. list-table:: :widths: 25 75 :header-rows: 1