From 2ff6ed253e76a9fdf8bc8a3a12dff60e0498f7c3 Mon Sep 17 00:00:00 2001 From: Yves P Date: Sat, 9 Jan 2016 14:29:30 +0100 Subject: [PATCH] Update setup instructions with MacOS instructions --- en/console-and-shells/completion-shell.rst | 44 ++++++++++++++++----- fr/console-and-shells/completion-shell.rst | 46 +++++++++++++++++----- 2 files changed, 70 insertions(+), 20 deletions(-) diff --git a/en/console-and-shells/completion-shell.rst b/en/console-and-shells/completion-shell.rst index 9117228635..7bed001b6d 100644 --- a/en/console-and-shells/completion-shell.rst +++ b/en/console-and-shells/completion-shell.rst @@ -55,8 +55,6 @@ For example:: Returns:: --help -h --verbose -v --quiet -q --everything --connection -c --force -f --plugin -p --prefix --theme -t -Vous pouvez passer un autre argument représentant une sous-commande du shell : -cela vous retournera les options spécifiques à cette sous-commande. You can also pass an additional argument being the shell sub-command : it will output the specific options of this sub-command. @@ -64,12 +62,30 @@ output the specific options of this sub-command. How to enable Bash autocompletion for the CakePHP Console ========================================================= -Using a Debian distribution ---------------------------- +First, make sure the **bash-completion** library is installed. If not, you do it +with the following command:: + + apt-get install bash-completion -First, make sure the **bash-completion** library is installed. Create a file named **cake** in **/etc/bash_completion.d/** and put the -following content inside it:: +:ref:`bash-completion-file-content` inside it. + +Save the file, then restart your console. + +.. note:: + + If you are using MacOS X, you can install the **bash-completion** library + using **homebrew** with the command ``brew install bash-completion``. + The target directory for the **cake** file will be + **/usr/local/etc/bash_completion.d/**. + +.. _bash-completion-file-content: + +Bash Completion file content +---------------------------- + +This is the code you need to put inside the **cake** file in the correct location +in order to get autocompletion when using the CakePHP console:: # # Bash completion file for CakePHP console @@ -123,7 +139,6 @@ following content inside it:: complete -F _cake cake bin/cake -Save the file, then restart your console. Using autocompletion ==================== @@ -132,13 +147,19 @@ Once enabled, the autocompletion can be used the same way than for other built-in commands, using the **TAB** key. Three type of autocompletion are provided. The following output are from a fresh CakePHP install. -#### Commands:: +Commands +-------- + +Sample output for commands autocompletion:: $ bin/cake bake i18n orm_cache routes console migrations plugin server -#### Subcommands:: +Subcommands +----------- + +Sample output for subcommands autocompletion:: $ bin/cake bake behavior helper shell @@ -148,7 +169,10 @@ Three type of autocompletion are provided. The following output are from a fresh fixture model form plugin -#### Options:: +Options +------- + +Sample output for subcommands options autocompletion:: $ bin/cake bake - -c --everything --force --help --plugin -q -t -v diff --git a/fr/console-and-shells/completion-shell.rst b/fr/console-and-shells/completion-shell.rst index 91ff0976e9..e2ecd2e16e 100644 --- a/fr/console-and-shells/completion-shell.rst +++ b/fr/console-and-shells/completion-shell.rst @@ -62,15 +62,34 @@ Retourne:: Vous pouvez passer un autre argument représentant une sous-commande du shell : cela vous retournera les options spécifiques à cette sous-commande. -Activer l'autocompletion Bash pour la console CakePHP +Activer l'autocomplétion Bash pour la console CakePHP ===================================================== -Avec une distribution Debian ----------------------------- - Tout d'abord, assurez-vous que la librairie **bash-completion** est installée. +Si elle ne l'est pas, vous pouvez le faire en exécutant la commande suivante:: + + apt-get install bash-completion + Créez un fichier **cake** dans **/etc/bash_completion.d/** et placez-y le -contenu suivant:: +:ref:`bash-completion-file-content`. + +Sauvegardez le fichier et rédémarrez la console. + +.. note:: + + Si vous utilisez MacOS X, vous pouvez installer la librairie + **bash-completion** en utilisant **homebrew** avec la commande suivante : + ``brew install bash-completion``. Le répertoire cible du fichier **cake** + devra être **/usr/local/etc/bash_completion.d/**. + +.. _bash-completion-file-content: + +Contenu du fichier bash d'autocomplétion +---------------------------------------- + +Voici le code que vous devez saisir dans le fichier **cake** (préalablement créé +au bon emplacement pour bénéficier de l'autocomplétion quand vous utilisez la +console CakePHP:: # # Fichier de completion Bash pour la console CakePHP @@ -124,8 +143,6 @@ contenu suivant:: complete -F _cake cake bin/cake -Sauvegardez le fichier et rédémarrer la console. - Utilisez l'autocompletion ========================= @@ -134,13 +151,19 @@ pour les autres commandes natives du système, en utilisant la touche **TAB**. Trois types d'autocompletion sont fournis. Les examples de retour qui suivent proviennent d'une installation fraîche de CakePHP. -#### Commandes:: +Commandes +--------- + +Exemple de rendu pour l'autocomplétion des commandes:: $ bin/cake bake i18n orm_cache routes console migrations plugin server -#### Subcommands:: +Sous-commandes +-------------- + +Exemple de rendu pour l'autocomplétion des sous-commandes:: $ bin/cake bake behavior helper shell @@ -150,7 +173,10 @@ proviennent d'une installation fraîche de CakePHP. fixture model form plugin -#### Options:: +Options +------- + +Exemple de rendu pour l'autocomplétion des options d'une sous-commande:: $ bin/cake bake - -c --everything --force --help --plugin -q -t -v