Move bash completion logic to new subcommand: stats
@@ -1595,7 +1595,20 @@ _docker_container_start() {
}
_docker_container_stats() {
- _docker_stats
+ case "$prev" in
+ --format)
+ return
+ ;;
+ esac
+
+ case "$cur" in
+ -*)
+ COMPREPLY=( $( compgen -W "--all -a --format --help --no-stream" -- "$cur" ) )
+ ;;
+ *)
+ __docker_complete_containers_running
+ ;;
+ esac
}
_docker_container_stop() {
@@ -2913,20 +2926,7 @@ _docker_start() {
}
_docker_stats() {
- case "$prev" in
- --format)
- return
- ;;
- esac
-
- case "$cur" in
- -*)
- COMPREPLY=( $( compgen -W "--all -a --format --help --no-stream" -- "$cur" ) )
- ;;
- *)
- __docker_complete_containers_running
- ;;
- esac
+ _docker_container_stats
}
_docker_stop() {
