Merge "Fix few small issues with dockerctl inspect"
This commit is contained in:
commit
4fec63f8d0
@ -96,7 +96,7 @@ case "$1" in
|
||||
shift
|
||||
$cmd "$@" ;;
|
||||
logs|inspect)
|
||||
if [[ $container == 'all' ]]; then
|
||||
if [[ $2 == 'all' ]]; then
|
||||
echo "You need to specify valid container name."
|
||||
echo "Use 'dockerctl list' to see available containers."
|
||||
|
||||
@ -104,7 +104,8 @@ case "$1" in
|
||||
fi
|
||||
|
||||
cmd=$1
|
||||
$cmd $container ;;
|
||||
shift
|
||||
$cmd "$@" ;;
|
||||
*)
|
||||
echo 'Invalid selection.'
|
||||
show_usage
|
||||
|
@ -372,7 +372,21 @@ function logs {
|
||||
}
|
||||
|
||||
function inspect {
|
||||
${DOCKER} inspect ${CONTAINER_NAMES[$1]}
|
||||
for container in $@; do
|
||||
found="$(docker ps -a -q --filter="name=${CONTAINER_NAMES[$container]}" | wc -l)"
|
||||
|
||||
if [[ $? -ne 0 || $found -ne 1 ]]; then
|
||||
echo "Could not find the $container container" 1>&2
|
||||
|
||||
if [[ $# -le 1 ]]; then
|
||||
docker inspect
|
||||
else
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
${DOCKER} inspect ${CONTAINER_NAMES[$container]}
|
||||
done
|
||||
}
|
||||
|
||||
function restart_container {
|
||||
|
Loading…
Reference in New Issue
Block a user