libcompose icon indicating copy to clipboard operation
libcompose copied to clipboard

Support Bash Completion

Open bohai opened this issue 9 years ago • 2 comments

This idea is to add bash completion for libcompose.

Below is a bash completion example:


// press tab twice after input "docker k", "kill" is completed and containers are printed.
root@SZX1000041895:~/sleep# docker ps
CONTAINER ID        IMAGE                        COMMAND             CREATED             STATUS              PORTS               NAMES
d3b5210874af        mbrt/golang-vim-dev:latest   "/bin/bash"         2 days ago          Up 2 days                               myvim

root@SZX1000041895:~/sleep# docker kill
d3b5210874af9c4d9fe9041a47928e551c719c2281758e73558f24234d36b807  myvim

//press tab when input "docker r", then all command that begins with "r" will be displayed.
root@SZX1000041895:~/sleep# docker help r
rename   restart  rm       rmi      run

bohai avatar Nov 06 '15 02:11 bohai

I think https://github.com/docker/compose/tree/master/contrib/completion should work, no?

dnephin avatar Nov 06 '15 02:11 dnephin

@bohai I think it should yeah (except for the docker-compose command part :stuck_out_tongue: https://github.com/docker/compose/blob/master/contrib/completion/bash/docker-compose#L443).

vdemeester avatar Nov 06 '15 07:11 vdemeester