Last active
December 21, 2016 20:42
-
-
Save stecman/e9109ddbdeed6efea8a4 to your computer and use it in GitHub Desktop.
Enable BASH completion for Composer
This file contains 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
diff --git a/composer.json b/composer.json | |
index 718b067..cebec32 100644 | |
--- a/composer.json | |
+++ b/composer.json | |
@@ -27,7 +27,8 @@ | |
"seld/jsonlint": "1.*", | |
"symfony/console": "~2.3", | |
"symfony/finder": "~2.2", | |
- "symfony/process": "~2.1" | |
+ "symfony/process": "~2.1", | |
+ "stecman/symfony-console-completion": "~0.3.0" | |
}, | |
"require-dev": { | |
"phpunit/phpunit": "~3.7" | |
diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php | |
index 4e2fa14..fdca3d1 100644 | |
--- a/src/Composer/Console/Application.php | |
+++ b/src/Composer/Console/Application.php | |
@@ -225,6 +225,7 @@ class Application extends BaseApplication | |
protected function getDefaultCommands() | |
{ | |
$commands = parent::getDefaultCommands(); | |
+ $commands[] = new \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand(); | |
$commands[] = new Command\AboutCommand(); | |
$commands[] = new Command\ConfigCommand(); | |
$commands[] = new Command\DependsCommand(); |
This can now be added without modifying Composer's code, using a (hacky) Composer plugin: Composer BASH completion plugin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To get this going after patching, run a
composer update
, then:or