-
Notifications
You must be signed in to change notification settings - Fork 43
Add tt run and tt instances #3395
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
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.. _tt-instances: | ||
|
||
Listing enabled applications | ||
============================ | ||
|
||
.. code-block:: bash | ||
|
||
tt instances | ||
|
||
``tt instances`` shows the list of enabled applications. | ||
|
||
.. note:: | ||
|
||
*Enabled* applications are applications that are stored inside the ``instances_enabled`` | ||
directory specified in the :ref:`tt configuration file <tt-config_file_app>`. | ||
They can be either running or not. To check if an application is running, | ||
use :doc:`tt status <status>`. | ||
|
||
Example | ||
-------- | ||
|
||
* Show the list of enabled applications: | ||
|
||
.. code-block:: bash | ||
|
||
tt instances |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
.. _tt-run: | ||
|
||
Running code in a Tarantool instance | ||
==================================== | ||
|
||
.. code-block:: bash | ||
|
||
tt run [SCRIPT|-e EXPR] [flags] | ||
|
||
``tt run`` executes Lua code in a Tarantool instance. | ||
|
||
Flags | ||
----- | ||
|
||
.. container:: table | ||
|
||
.. list-table:: | ||
:widths: 30 70 | ||
:header-rows: 0 | ||
|
||
* - ``-e EXPR`` | ||
|
||
``--evaluate EXPR`` | ||
- Execute the specified expression in a Tarantool instance | ||
* - ``-l LIB_NAME`` | ||
|
||
``--library LIB_NAME`` | ||
- Require the specified library | ||
* - ``-i`` | ||
|
||
``--interactive`` | ||
- Enter the interactive mode after the script execution | ||
* - ``-v`` | ||
|
||
``--version`` | ||
- Print the Tarantool version that is used for script execution | ||
|
||
Details | ||
------- | ||
|
||
``tt run`` executes arbitrary Lua code in a Tarantool instance. The code can be | ||
provided either in a Lua file, or in a string passed after the ``-e``/``--evaluate`` | ||
flag. When called without arguments or flags, ``tt run`` opens the Tarantool console. | ||
|
||
If libraries are required for execution, pass their names after the ``-l``/``--library`` | ||
flag. | ||
|
||
By default, a Tarantool instance started by ``tt run`` shuts down after code | ||
execution completes. To leave this instance running and continue working in its | ||
p7nov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
console, add the ``-i``/``--interactive`` flag. | ||
|
||
Examples | ||
-------- | ||
|
||
* Execute the ``app.lua`` file in a Tarantool instance: | ||
|
||
.. code-block:: bash | ||
|
||
tt run app.lua | ||
|
||
* Execute an expression in a Tarantool instance: | ||
|
||
.. code-block:: bash | ||
|
||
tt run -e "print('hi there')" | ||
|
||
* Execute the ``app.lua`` file in a Tarantool instance and leave it running: | ||
|
||
.. code-block:: bash | ||
|
||
tt run app.lua -i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.