Signed-off-by: Michael Scharf <github@scharf.gr>
| ... | ... |
@@ -46,6 +46,22 @@ __docker_containers_stopped() |
| 46 | 46 |
COMPREPLY=( $( compgen -W "$names $containers" -- "$cur" ) ) |
| 47 | 47 |
} |
| 48 | 48 |
|
| 49 |
+__docker_containers_paused() |
|
| 50 |
+{
|
|
| 51 |
+ local containers="$( __docker_q ps -q)" |
|
| 52 |
+ local names="$( __docker_q inspect --format='{{.State.Paused}} {{.Name}}' $containers | sed 's/^false.*//' | sed 's,^true /,,' )"
|
|
| 53 |
+ local hostnames="$( __docker_q inspect --format='{{.State.Paused}} {{.Config.Hostname}}' $containers | sed 's/^false.*//' | sed 's,^true ,,' )"
|
|
| 54 |
+ COMPREPLY=( $( compgen -W "$names $hostnames" -- "$cur" ) ) |
|
| 55 |
+} |
|
| 56 |
+ |
|
| 57 |
+__docker_containers_not_paused() |
|
| 58 |
+{
|
|
| 59 |
+ local containers="$( __docker_q ps -q)" |
|
| 60 |
+ local names="$( __docker_q inspect --format='{{.State.Paused}} {{.Name}}' $containers | sed 's/^true.*//' | sed 's,^false /,,' )"
|
|
| 61 |
+ local hostnames="$( __docker_q inspect --format='{{.State.Paused}} {{.Config.Hostname}}' $containers | sed 's/^true.*//' | sed 's/^false //' )"
|
|
| 62 |
+ COMPREPLY=( $( compgen -W "$names $hostnames" -- "$cur" ) ) |
|
| 63 |
+} |
|
| 64 |
+ |
|
| 49 | 65 |
__docker_image_repos() |
| 50 | 66 |
{
|
| 51 | 67 |
local repos="$( __docker_q images | awk 'NR>1{print $1}' | grep -v '^<none>$' )"
|
| ... | ... |
@@ -453,6 +469,13 @@ _docker_logs() |
| 453 | 453 |
;; |
| 454 | 454 |
esac |
| 455 | 455 |
} |
| 456 |
+_docker_pause() |
|
| 457 |
+{
|
|
| 458 |
+ local counter=$(__docker_pos_first_nonflag) |
|
| 459 |
+ if [ $cword -eq $counter ]; then |
|
| 460 |
+ __docker_containers_not_paused |
|
| 461 |
+ fi |
|
| 462 |
+} |
|
| 456 | 463 |
|
| 457 | 464 |
_docker_port() |
| 458 | 465 |
{
|
| ... | ... |
@@ -714,6 +737,14 @@ _docker_tag() |
| 714 | 714 |
esac |
| 715 | 715 |
} |
| 716 | 716 |
|
| 717 |
+_docker_unpause() |
|
| 718 |
+{
|
|
| 719 |
+ local counter=$(__docker_pos_first_nonflag) |
|
| 720 |
+ if [ $cword -eq $counter ]; then |
|
| 721 |
+ __docker_containers_paused |
|
| 722 |
+ fi |
|
| 723 |
+} |
|
| 724 |
+ |
|
| 717 | 725 |
_docker_top() |
| 718 | 726 |
{
|
| 719 | 727 |
local counter=$(__docker_pos_first_nonflag) |
| ... | ... |
@@ -754,6 +785,7 @@ _docker() |
| 754 | 754 |
load |
| 755 | 755 |
login |
| 756 | 756 |
logs |
| 757 |
+ pause |
|
| 757 | 758 |
port |
| 758 | 759 |
ps |
| 759 | 760 |
pull |
| ... | ... |
@@ -768,6 +800,7 @@ _docker() |
| 768 | 768 |
stop |
| 769 | 769 |
tag |
| 770 | 770 |
top |
| 771 |
+ unpause |
|
| 771 | 772 |
version |
| 772 | 773 |
wait |
| 773 | 774 |
" |