8000 minor #20056 Document Symfony CLI autocompletion (tucksaun) · symfony/symfony-docs@f594cd3 · GitHub
[go: up one dir, main page]

Skip to content

Commit f594cd3

Browse files
committed
minor #20056 Document Symfony CLI autocompletion (tucksaun)
This PR was submitted for the 7.1 branch but it was merged into the 5.4 branch instead. Discussion ---------- Document Symfony CLI autocompletion I recently implemented autocompletion for any tools based on [symfony-cli/console](https://github.com/symfony-cli/console) including Symfony CLI (see symfony-cli/console#11). I also added completion forwarding for `composer` and `console` (see symfony-cli/symfony-cli#493). This means that you can have the autocompletion for the 3 tools by following `symfony completion --help` instructions and that it will automatically use the right configuration (ie. PHP version, `php.ini`, etc) when running it. Note: I opened the PR against `7.1` but technically this is not related to any `Symfony version`, let me know if you want me to change the target version. Commits ------- 52f1f00 Document Symfony CLI autocompletion
2 parents ffe0c15 + 52f1f00 commit f594cd3

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

console.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ options by pressing the Tab key.
103103
104104
$ php vendor/bin/phpstan completion bash | sudo tee /etc/bash_completion.d/phpstan
105105
106+
.. tip::
107+
108+
If you are using the :doc:`Symfony local web server
109+
</setup/symfony_server>`, it is recommended to use the builtin completion
110+
script that will ensure the right PHP version and configuration is used when
111+
running the Console Completion. Run ``symfony completion --help`` for the
112+
installation instructions for your shell. The Symfony CLI will provide
113+
completion for the ``console`` and ``composer`` commands.
114+
106115
Creating a Command
107116
------------------
108117

setup/symfony_server.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ Installation
1717
The Symfony server is part of the ``symfony`` binary created when you
1818
`install Symfony`_ and has support for Linux, macOS and Windows.
1919

20+
.. tip::
21+
22+
The Symfony CLI supports auto completion for Bash, Zsh or Fish shells. You
23+
have to install the completion script *once*. Run ``symfony completion
24+
--help`` for the installation instructions for your shell. After installing
25+
and restarting your terminal, you're all set to use completion (by default,
26+
by pressing the Tab key).
27+
< 603B div aria-hidden="true" class="position-absolute top-0 d-flex user-select-none DiffLineTableCellParts-module__comment-indicator--eI0hb">
28+
The Symfony CLI will also provide completion for the ``composer`` command
29+
and for the ``console`` command if it detects a Symfony project.
30+
2031
.. note::
2132

2233
You can view and contribute to the Symfony CLI source in the

0 commit comments

Comments
 (0)
0