From 8f33bb46b57140cc14bb97a11628f01bdcb1efd4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 11 Dec 2016 11:26:46 +0100 Subject: Renaming internal show function in container list command for consistency. Signed-off-by: Daniel Baumann --- lib/container/list | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/container/list b/lib/container/list index a5f1e62..714c803 100755 --- a/lib/container/list +++ b/lib/container/list @@ -97,27 +97,7 @@ FORMAT="${FORMAT:-full}" HOST="${HOST:-$(hostname -f)}" # Run -case "${FORMAT}" in - full) - RED="$(tput setaf 1)$(tput bold)" - GREEN="$(tput setaf 2)$(tput bold)" - YELLOW="$(tput setaf 3)$(tput bold)" - BLUE="$(tput setaf 4)$(tput bold)" - WHITE="$(tput setaf 7)$(tput bold)" - NORMAL="$(tput sgr0)" - -cat << EOF -${WHITE} ${NORMAL} Container IPv4 Address(es) --------------------------------------------------------------------------------- -EOF - - ;; - - short) - ;; -esac - -Show () +List () { case "${FORMAT}" in short) @@ -144,6 +124,26 @@ Show () esac } +case "${FORMAT}" in + full) + RED="$(tput setaf 1)$(tput bold)" + GREEN="$(tput setaf 2)$(tput bold)" + YELLOW="$(tput setaf 3)$(tput bold)" + BLUE="$(tput setaf 4)$(tput bold)" + WHITE="$(tput setaf 7)$(tput bold)" + NORMAL="$(tput sgr0)" + +cat << EOF +${WHITE} ${NORMAL} Container IPv4 Address(es) +-------------------------------------------------------------------------------- +EOF + + ;; + + short) + ;; +esac + CONTAINERS="$(cd "${MACHINES}" 2>/dev/null && find -maxdepth 1 -type d -and -not -name '.container-tools' -and -not -name 'container-tools' -and -not -name 'lost+found' -and -not -name '.snap' -and -not -name '.snapshot' -printf '%P\n' | sort)" for CONTAINER in ${CONTAINERS} @@ -197,7 +197,7 @@ do if echo ${LIST} | grep -qs all then - Show + List fi for ITEM in other started stopped @@ -206,7 +206,7 @@ do then case "${STATE}" in ${ITEM}) - Show + List ;; esac fi -- cgit v1.2.3