Giter Club home page Giter Club logo

composer-autocomplete's Introduction

Bash/Shell Autocompletion for Composer

Source License

composer-autocomplete provides Bash/Shell autocompletion for Composer.

Built by Bram(us) Van Damme (https://www.bram.us) and Contributors

Prerequisites

If the complete command is not available on your system, you can install bash-completion using Homebrew

brew install bash-completion

Installation

  1. Download the file composer-autocomplete from this repo

    curl -#L https://github.com/bramus/composer-autocomplete/tarball/master | tar -xzv --strip-components 1 --exclude={LICENSE,README.md}
  2. Move the file composer-autocomplete to ~

    mv ./composer-autocomplete ~/composer-autocomplete
  3. Load composer-autocomplete from within your ~/.bash_profile

    Either manually add this snippet to your ~/.bash_profile:

    if [ -f "$HOME/composer-autocomplete" ] ; then
        . $HOME/composer-autocomplete
    fi

    Or use this set of commands to do it automatically:

    echo "" >> ~/.bash_profile
    echo 'if [ -f "$HOME/composer-autocomplete" ] ; then' >> ~/.bash_profile
    echo '    . $HOME/composer-autocomplete' >> ~/.bash_profile
    echo "fi" >> ~/.bash_profile
  4. Restart your shell, or reload your ~/.bash_profile

    source ~/.bash_profile

Usage

To list composer commands:

$ composer [TAB][TAB]
about                clear-cache          create-project       dumpautoload         home                 install              prohibits            search               status               upgrade
archive              clearcache           depends              exec                 i                    licenses             remove               self-update          suggests             validate
browse               command              diagnose             global               info                 list                 require              selfupdate           u                    why
check-platform-reqs  config               dump-autoload        help                 init                 outdated             run-script           show                 update               why-not

To complete a composer commands:

$ composer in[TAB][TAB]
info     init     install

To list options for a composer command:

$ composer install -[TAB][TAB]
--                        --dev                     --no-ansi                 --no-interaction          --no-suggest              --profile                 --working-dir             -h                        -v
--ansi                    --dry-run                 --no-autoloader           --no-plugins              --optimize-autoloader     --quiet                   -V                        -n
--apcu-autoloader         --help                    --no-custom-installers    --no-progress             --prefer-dist             --verbose                 -a                        -o
--classmap-authoritative  --ignore-platform-reqs    --no-dev                  --no-scripts              --prefer-source           --version                 -d                        -q

To complete Composer scripts (example):

$ composer run-script [TAB][TAB]
fix   lint  test

Acknowledgements

This project builds upon Rob Allen's previous work in this area.

License

composer-autocomplete is released under the MIT public license. See the enclosed LICENSE for details.

composer-autocomplete's People

Contributors

bramus avatar mundry avatar seifertdaniel avatar troggybrains avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

composer-autocomplete's Issues

Complete package names for more commands

AFAICT package names currently are completed only for the update command. I think it would be useful for:

  • show / info
  • prohibits / why-not
  • depends/ why

And maybe some more. Should I provide a PR or will you make a quick update yourself?

PS! Thx for the excellent work.

Zsh: command not found: complete

I followed the same installation instructions but after running

$ source ~/.zshrc

getting this error: /home/ahmedwaleed/composer-autocomplete:39: command not found: complete

Inside .zshrc

if [ -f "$HOME/composer-autocomplete" ] ; then
    . $HOME/composer-autocomplete
fi

_get_comp_words_by_ref: command not found

Hello,

I'm trying to use this on macOS. After installation I type composer [TAB][TAB] and get the following error:

composer -bash: _get_comp_words_by_ref: command not found

Image for clarification:
Screenshot 2019-05-31 at 09 43 24

I've tried installing bash-autocompletion with brew install bash-completion but that didn't work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.