You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Add an instance of `CompletionCommand` to your application's `Application::getDefaultCommands()` method:
26
+
2. For standalone Symfony Console applications, add an instance of `CompletionCommand` to your application's `Application::getDefaultCommands()` method:
27
+
28
+
```php
29
+
protected function getDefaultCommands()
30
+
{
31
+
//...
32
+
$commands[] = new \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand();
33
+
//...
34
+
}
35
+
```
36
+
37
+
For Symfony Framework applications, register the `CompletionCommand` as a service in `app/config/services.yml`:
27
38
28
-
```php
29
-
protected function getDefaultCommands()
30
-
{
31
-
//...
32
-
$commands[] = new \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand();
3. Register completion for your application by running one of the following in a terminal, replacing `[program]` with the command you use to run your application (eg. 'composer'):
By default this registers completion for the absolute path to you application, which will work if the program on accessible on your PATH. You can specify a program name to complete for instead using the `--program` option, which is required if you're using an alias to run the program.
62
+
By default this registers completion for the absolute path to you application, which will work if the program on accessible on your PATH. You can specify a program name to complete for instead using the `--program` option, which is required if you're using an alias to run the program.
51
63
52
64
4. If you want the completion to apply automatically for all new shell sessions, add the command from step 3 to your shell's profile (eg. `~/.bash_profile` or `~/.zshrc`)
53
65
@@ -71,7 +83,7 @@ By default, no completion results will be returned for option and argument value
71
83
class MyCommand extends Command implements CompletionAwareInterface
72
84
{
73
85
...
74
-
86
+
75
87
public function completeOptionValues($optionName, CompletionContext $context)
0 commit comments