mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-26 21:51:05 +01:00
Fixing some issues where show repeated weird values, and fixed commands that need the container autocomplete without being running, like start, now it autocompletes showing all the containers so you can start without knowing the right name
This commit is contained in:
parent
ff4663a6b8
commit
2dbf9951d9
1 changed files with 16 additions and 5 deletions
|
@ -12,6 +12,15 @@
|
||||||
__docker_containers() {
|
__docker_containers() {
|
||||||
declare -a cont_cmd
|
declare -a cont_cmd
|
||||||
cont_cmd=($(docker ps | awk 'NR>1{print $NF":[CON("$1")"$2"("$3")]"}'))
|
cont_cmd=($(docker ps | awk 'NR>1{print $NF":[CON("$1")"$2"("$3")]"}'))
|
||||||
|
if [[ 'X$cont_cmd' != 'X' ]]
|
||||||
|
_describe 'containers' cont_cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
# Output a selectable list of all containers, even not running
|
||||||
|
__docker_all_containers() {
|
||||||
|
declare -a cont_cmd
|
||||||
|
cont_cmd=($(docker ps -a | awk 'NR>1{print $NF":[CON("$1")"$2"("$3")]"}'))
|
||||||
|
if [[ 'X$cont_cmd' != 'X' ]]
|
||||||
_describe 'containers' cont_cmd
|
_describe 'containers' cont_cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,10 +107,12 @@ __insert() {
|
||||||
|
|
||||||
__inspect() {
|
__inspect() {
|
||||||
__docker_images
|
__docker_images
|
||||||
__docker_containers
|
__docker_all_containers
|
||||||
}
|
}
|
||||||
|
|
||||||
__kill() {
|
__kill() {
|
||||||
|
_arguments \
|
||||||
|
'(-s,--signal=)'{-s,--signal=}'[KILL Signal]'
|
||||||
__docker_containers
|
__docker_containers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +173,7 @@ __rm() {
|
||||||
'(-f,--force=)'{-f,--force=}'[Force removal of running container]' \
|
'(-f,--force=)'{-f,--force=}'[Force removal of running container]' \
|
||||||
'(-l,--link=)'{-l,--link=}'[Remove the specified link and not the underlying container]' \
|
'(-l,--link=)'{-l,--link=}'[Remove the specified link and not the underlying container]' \
|
||||||
'(-v,--volumes=)'{-v,--volumes=}'[Remove the volumes associated to the container]'
|
'(-v,--volumes=)'{-v,--volumes=}'[Remove the volumes associated to the container]'
|
||||||
__docker_containers
|
__docker_all_containers
|
||||||
}
|
}
|
||||||
|
|
||||||
__rmi() {
|
__rmi() {
|
||||||
|
@ -216,7 +227,7 @@ __start() {
|
||||||
_arguments \
|
_arguments \
|
||||||
'(-a,--attach=)'{-a,--attach=}'[Attach container''s stdout/stderr and forward all signals to the process]' \
|
'(-a,--attach=)'{-a,--attach=}'[Attach container''s stdout/stderr and forward all signals to the process]' \
|
||||||
'(-i,--interactive=)'{-i,--interactive=}'[Attach container''s stdin]'
|
'(-i,--interactive=)'{-i,--interactive=}'[Attach container''s stdin]'
|
||||||
__docker_containers
|
__docker_all_containers
|
||||||
}
|
}
|
||||||
|
|
||||||
__stats() {
|
__stats() {
|
||||||
|
|
Loading…
Reference in a new issue