2017 © Pedro Peláez
 

composer-plugin composer-bash-completion-plugin

image

stecman/composer-bash-completion-plugin

  • Wednesday, November 29, 2017
  • by stecman
  • Repository
  • 2 Watchers
  • 58 Stars
  • 2,199 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 2 Open issues
  • 1 Versions
  • 13 % Grown

The README.md

BASH/ZSH auto-complete plugin for Composer

This is an experimental hack to add Symfony BASH auto complete to Composer via a plugin. It's a pretty slimy hack, but it works without editing Composer's code., (*1)

Composer BASH completion, (*2)

Installation

  1. Install the plugin:, (*3)

    composer global require stecman/composer-bash-completion-plugin dev-master
    
  2. Generate code to register a completion hook for your shell and Composer configuration:, (*4)

    source $(composer config home --global)/vendor/stecman/composer-bash-completion-plugin/generate-hook
    
  3. Add the registration code to your shell profile:, (*5)

  • If you're using BASH, copy the output to your ~/.bash_profile
  • If you're using ZSH, copy the output to your ~/.zshrc
  1. Reload your modified shell config (or open a new shell), and enjoy tab completion on Composer

Explanation

This hacky plugin injects an additional command into the Composer application at runtime. When the plugin in this package is activated and the command line starts with composer depends _completion, the plugin effectively reboots the application with the completion command added, and drops depends from the command line so that _completion becomes the command argument. This used to work without piggy-backing on a command, but an update to composer stopped the original method working (#8)., (*6)

The Versions

29/11 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires