I always wanted to have the PEAR commands get auto completed on my bash. Here is how it works:
complete -W "`pear 2>&1 | awk '{ORS=" "} /[a-zA-Z-]+ / {print $1}'`" -f pear
Simply run the command in your shell and/or add it to e.g. your .bashrc. You will have autocompletion for all PEAR Installer commands and for filenames in paralell.
Usually I'd have expected to get the stuff working using complete's "-C" option, this did not work for me, I got a list of all possible commands when typing <tab><tab>, but neither a correct completion suggestion nor a completion.
If you liked this blog post or learned something, please consider using flattr to contribute back: .
Fields with bold names are mandatory.
Auto-complete for PEAR commandline
First of all let me reiterate that if you're not taking advantage of the PEAR commandline installer you're missing out on one of the best aspects of PHP.Now, thanks to Tobias, using PEAR at the commandline has become easier than every with auto-complete e
code completion für apt-get
Nachdem ich die code completion für PEAR gesehen hatte, hab ich das gleich mal für das Tool nachgebaut, das ich noch häufiger verwende: apt-get
Also einfach das hier in die ~/.bashrc und apt-get TAB komplettiert
complete -W "`apt-get 2>&1 | awk '{ORS=