diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2016-12-11 10:26:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2016-12-11 10:27:37 +0000 |
commit | 8f33bb46b57140cc14bb97a11628f01bdcb1efd4 (patch) | |
tree | 0a0e293f01cdd05ba828d9297eec957f6343f997 /lib | |
parent | Completing usage message in container list command. (diff) | |
download | compute-tools-8f33bb46b57140cc14bb97a11628f01bdcb1efd4.tar.xz compute-tools-8f33bb46b57140cc14bb97a11628f01bdcb1efd4.zip |
Renaming internal show function in container list command for consistency.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/container/list | 46 |
1 files 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 |