Move bash completion logic to new subcommand: top
@@ -1629,7 +1629,17 @@ _docker_container_stop() {
}
_docker_container_top() {
- _docker_top
+ case "$cur" in
+ -*)
+ COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
+ ;;
+ *)
+ local counter=$(__docker_pos_first_nonflag)
+ if [ $cword -eq $counter ]; then
+ __docker_complete_containers_running
+ fi
+ ;;
+ esac
}
_docker_container_unpause() {
@@ -3022,17 +3032,7 @@ _docker_update() {
}
_docker_top() {
- case "$cur" in
- -*)
- COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
- ;;
- *)
- local counter=$(__docker_pos_first_nonflag)
- if [ $cword -eq $counter ]; then
- __docker_complete_containers_running
- fi
- ;;
- esac
+ _docker_container_top
}
_docker_version() {
