Add bash completion for docker service logs
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 105231556a
)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
parent
10d999d7ab
commit
73b9bdc6cb
1 changed files with 22 additions and 0 deletions
|
@ -2599,6 +2599,8 @@ _docker_service() {
|
||||||
ps
|
ps
|
||||||
update
|
update
|
||||||
"
|
"
|
||||||
|
__docker_daemon_is_experimental && subcommands+="logs"
|
||||||
|
|
||||||
__docker_subcommands "$subcommands" && return
|
__docker_subcommands "$subcommands" && return
|
||||||
|
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
|
@ -2631,6 +2633,26 @@ _docker_service_inspect() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_docker_service_logs() {
|
||||||
|
case "$prev" in
|
||||||
|
--since|--tail)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$cur" in
|
||||||
|
-*)
|
||||||
|
COMPREPLY=( $( compgen -W "--details --follow -f --help --no-resolve --since --tail --timestamps -t" -- "$cur" ) )
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
local counter=$(__docker_pos_first_nonflag '--since|--tail')
|
||||||
|
if [ $cword -eq $counter ]; then
|
||||||
|
__docker_complete_services
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
_docker_service_list() {
|
_docker_service_list() {
|
||||||
_docker_service_ls
|
_docker_service_ls
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue