mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add bash completion for "docker rm -f" and complete on all containers instead of just stopped containers when "-f" is specified
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
This commit is contained in:
parent
917b7436af
commit
5e256799dd
1 changed files with 12 additions and 1 deletions
|
@ -458,10 +458,21 @@ _docker_rm()
|
||||||
{
|
{
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
-*)
|
-*)
|
||||||
COMPREPLY=( $( compgen -W "-v --volumes -l --link" -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "-f --force -l --link -v --volumes" -- "$cur" ) )
|
||||||
|
return
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
local force=
|
||||||
|
for arg in "${COMP_WORDS[@]}"; do
|
||||||
|
case "$arg" in
|
||||||
|
-f|--force)
|
||||||
|
__docker_containers_all
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
__docker_containers_stopped
|
__docker_containers_stopped
|
||||||
|
return
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue