From a4b1769bb600edf9c7542247fccc3e7dae074da0 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Mon, 3 Jul 2017 18:03:00 +0200 Subject: [PATCH] Add bash completion for `dockerd --storage-opt overlay2.size` This adds bash completion for - https://github.com/docker/cli/pull/215 - https://github.com/moby/moby/pull/32977 Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 33ada275b1..5a81a21eb2 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -2069,7 +2069,7 @@ _docker_daemon() { return ;; --storage-driver|-s) - COMPREPLY=( $( compgen -W "aufs btrfs devicemapper overlay overlay2 vfs zfs" -- "$(echo $cur | tr '[:upper:]' '[:lower:]')" ) ) + COMPREPLY=( $( compgen -W "aufs btrfs devicemapper overlay overlay2 vfs zfs" -- "$(echo $cur | tr '[:upper:]' '[:lower:]')" ) ) return ;; --storage-opt) @@ -2094,11 +2094,14 @@ _docker_daemon() { dm.use_deferred_deletion dm.use_deferred_removal " + local overlay2_options="overlay2.size" local zfs_options="zfs.fsname" + local all_options="$btrfs_options $devicemapper_options $overlay2_options $zfs_options" + case $(__docker_value_of_option '--storage-driver|-s') in '') - COMPREPLY=( $( compgen -W "$btrfs_options $devicemapper_options $zfs_options" -S = -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$all_options" -S = -- "$cur" ) ) ;; btrfs) COMPREPLY=( $( compgen -W "$btrfs_options" -S = -- "$cur" ) ) @@ -2106,6 +2109,9 @@ _docker_daemon() { devicemapper) COMPREPLY=( $( compgen -W "$devicemapper_options" -S = -- "$cur" ) ) ;; + overlay2) + COMPREPLY=( $( compgen -W "$overlay2_options" -S = -- "$cur" ) ) + ;; zfs) COMPREPLY=( $( compgen -W "$zfs_options" -S = -- "$cur" ) ) ;;