zend-patterns / ZendServerSDK

Pure ZF2 CLI for zpk creation and webapi client.
BSD 3-Clause "New" or "Revised" License
22 stars 17 forks source link

Add auto-complete support for bash #36

Closed slaff closed 10 years ago

slaff commented 10 years ago

Add autocomplete suggestions for bash http://www.gnu.org/software/bash/manual/bash.html#Programmable-Completion, http://www.debian-administration.org/articles/316 .

zvikazend commented 10 years ago

Very good good idea, although it is BASH only. I implemented BASH comspec for zendctl.sh back in Zend Server 4 as a POC, it was very nice to have and I was actually using it all over. zs-manage and then ZS-SDK are much wider tools than zendctl so this can be wonderful to have for commands list / completion and params list/completion (although I would use the first letter and not --, for example t[tab] suggests --target instead of --t[tab]). Cool idea.

slaff commented 10 years ago

Ready for testing.

Installation: Run these commands

bin/zs-client.php autocomplete >> ~/.bashrc
source ~/.bashrc

And then run bin/zs-client.php [TAB] or bin/zs-client.php addTarget [TAB] to test.