diff --git a/CHANGELOG.md b/CHANGELOG.md index caf467c..2ef8565 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ To view the diff between two versions, go to https://github.com/joomlatools/joom * Fixed - Consolidate the PHP ini files into a single custom.ini file * Improved - Automatically change directory to /var/www when logging in via `vagrant ssh` or web terminal * Improved - Added /terminal, /mailcatcher and /filebrowser aliases + * Improved - Added bash autocompletion to the `box` command * 1.3.1 (2015-09-03) * Added - Support for PHP7 diff --git a/puppet/modules/box/files/scripts/box b/puppet/modules/box/files/scripts/box index 071b17e..687d542 100755 --- a/puppet/modules/box/files/scripts/box +++ b/puppet/modules/box/files/scripts/box @@ -5,6 +5,7 @@ $autoload = __DIR__.'/vendor/autoload.php'; require_once $autoload; use Symfony\Component\Console\Application; +use \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand; spl_autoload_register(function($className) { $className = ltrim($className, '\\'); @@ -24,6 +25,8 @@ spl_autoload_register(function($className) { $application = new Application('Joomlatools Box', '0.1'); +$application->add(new CompletionCommand()); + $application->add(new Command\Apc\Enable()); $application->add(new Command\Apc\Disable()); $application->add(new Command\Apc\Clear()); diff --git a/puppet/modules/box/manifests/init.pp b/puppet/modules/box/manifests/init.pp index 6201b0c..85eb0de 100644 --- a/puppet/modules/box/manifests/init.pp +++ b/puppet/modules/box/manifests/init.pp @@ -7,7 +7,7 @@ } exec { 'fetch-box-dependencies': - command => 'composer require symfony/console:2.4.* --no-interaction', + command => 'composer require symfony/console:2.7.* stecman/symfony-console-completion --no-interaction', cwd => '/home/vagrant/box', unless => '[ -d /home/vagrant/box/vendor/symfony ]', path => '/usr/bin', @@ -26,4 +26,11 @@ unless => 'grep ":/home/vagrant/box" /home/vagrant/.bash_profile', require => Exec['make-box-executable'] } + + file_line { 'register-box-autocompletion': + path => '/home/vagrant/.bash_profile', + line => 'source <(/home/vagrant/box/box _completion --generate-hook --program=box)', + require => File['/home/vagrant/.bash_profile'] + } + } \ No newline at end of file