Skip to content

Commit dbbb519

Browse files
juhoautiobranchv
andauthored
Docs: Update Autocompletion section (#151)
* Docs: Update Autocompletion section Aligning this section in the doc site to match with the root README * Update docs/introduction.rst Co-authored-by: Branch Vincent <[email protected]> * Align README.md Co-authored-by: Branch Vincent <[email protected]>
1 parent ff2a2bb commit dbbb519

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -446,16 +446,7 @@ the `call_silent()` method instead.
446446

447447
Cleo supports automatic (tab) completion in `bash`, `zsh` and `fish`.
448448

449-
To activate support for autocompletion, pass a `complete` keyword when
450-
initializing your application:
451-
452-
```python
453-
application = Application("My Application", "0.1", complete=True)
454-
```
455-
456-
Now, register completion for your application by running one of the
457-
following in a terminal, replacing `[program]` with the command you use
458-
to run your application:
449+
By default, your application will have a `completions` command. To register these completions for your application, run one of the following in a terminal (replacing `[program]` with the command you use to run your application):
459450

460451
```bash
461452
# Bash

docs/introduction.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -500,21 +500,23 @@ Autocompletion
500500

501501
Cleo supports automatic (tab) completion in ``bash``, ``zsh`` and ``fish``.
502502

503-
You can register completion for your application by running one of the following in a terminal,
504-
replacing ``[program]`` with the command you use to run your application:
503+
By default, your application will have a ``completions`` command. To register these completions for your application, run one of the following in a terminal (replacing ``[program]`` with the command you use to run your application):
505504

506505
.. code-block:: bash
507506
508-
# BASH - Ubuntu / Debian
507+
# Bash
509508
[program] completions bash | sudo tee /etc/bash_completion.d/[program].bash-completion
510509
511-
# BASH - Mac OSX (with Homebrew "bash-completion")
510+
# Bash - macOS/Homebrew (requires `brew install bash-completion`)
512511
[program] completions bash > $(brew --prefix)/etc/bash_completion.d/[program].bash-completion
513512
514-
# ZSH - Config file
513+
# Zsh
515514
mkdir ~/.zfunc
516515
echo "fpath+=~/.zfunc" >> ~/.zshrc
517-
[program] completions zsh > ~/.zfunc/_test
516+
[program] completions zsh > ~/.zfunc/_[program]
518517
519-
# FISH
518+
# Zsh - macOS/Homebrew
519+
[program] completions zsh > $(brew --prefix)/share/zsh/site-functions/_[program]
520+
521+
# Fish
520522
[program] completions fish > ~/.config/fish/completions/[program].fish

0 commit comments

Comments
 (0)