mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-27 03:05:39 +01:00
Merge 82aab6bf51 into 96e4e5dd03
This commit is contained in:
commit
c82f0cf1be
1 changed files with 19 additions and 1 deletions
|
|
@ -14,6 +14,13 @@ __docker_containers() {
|
||||||
_describe 'containers' cont_cmd
|
_describe 'containers' cont_cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Output a list of all containers (both running and stopped)
|
||||||
|
__docker_containers_all() {
|
||||||
|
declare -a cont_cmd
|
||||||
|
cont_cmd=($(docker ps -a | awk 'NR>1{print $1":[CON("$1")"$2"("$3")]"}'))
|
||||||
|
_describe 'containers' cont_cmd
|
||||||
|
}
|
||||||
|
|
||||||
# output a selectable list of all docker images
|
# output a selectable list of all docker images
|
||||||
__docker_images() {
|
__docker_images() {
|
||||||
declare -a img_cmd
|
declare -a img_cmd
|
||||||
|
|
@ -61,6 +68,14 @@ __events() {
|
||||||
'--since=[Show previously created events and then stream.]'
|
'--since=[Show previously created events and then stream.]'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__exec() {
|
||||||
|
_arguments \
|
||||||
|
'-d[Detached mode: run command in the background]' \
|
||||||
|
'-i[Keep STDIN open even if not attached]' \
|
||||||
|
'-t[Allocate a pseudo-TTY]'
|
||||||
|
__docker_containers
|
||||||
|
}
|
||||||
|
|
||||||
__export() {
|
__export() {
|
||||||
__docker_containers
|
__docker_containers
|
||||||
}
|
}
|
||||||
|
|
@ -161,7 +176,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_containers_all
|
||||||
}
|
}
|
||||||
|
|
||||||
__rmi() {
|
__rmi() {
|
||||||
|
|
@ -249,6 +264,7 @@ _1st_arguments=(
|
||||||
"cp":"Copy files/folders from the containers filesystem to the host path"
|
"cp":"Copy files/folders from the containers filesystem to the host path"
|
||||||
"diff":"Inspect changes on a container's filesystem"
|
"diff":"Inspect changes on a container's filesystem"
|
||||||
"events":"Get real time events from the server"
|
"events":"Get real time events from the server"
|
||||||
|
"exec":"Run a command in an existing container"
|
||||||
"export":"Stream the contents of a container as a tar archive"
|
"export":"Stream the contents of a container as a tar archive"
|
||||||
"history":"Show the history of an image"
|
"history":"Show the history of an image"
|
||||||
"images":"List images"
|
"images":"List images"
|
||||||
|
|
@ -299,6 +315,8 @@ case "$words[1]" in
|
||||||
__diff ;;
|
__diff ;;
|
||||||
events)
|
events)
|
||||||
__events ;;
|
__events ;;
|
||||||
|
exec)
|
||||||
|
__exec ;;
|
||||||
export)
|
export)
|
||||||
__export ;;
|
__export ;;
|
||||||
history)
|
history)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue