Commit cd7adf3c authored by Vitaly Lipatov's avatar Vitaly Lipatov

implement option_all and use it

parent 04a24815
...@@ -138,6 +138,7 @@ case $CMD in ...@@ -138,6 +138,7 @@ case $CMD in
fi fi
# Size too hard # Size too hard
#docmd docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}' "$@" #docmd docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}' "$@"
# allow -a, --all
docmd docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}' "$@" docmd docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}' "$@"
info "See evz ports ID for print ports" info "See evz ports ID for print ports"
;; ;;
......
...@@ -55,3 +55,10 @@ arg_is_all() ...@@ -55,3 +55,10 @@ arg_is_all()
[ "$1" = "all" ] && return [ "$1" = "all" ] && return
return 1 return 1
} }
option_all()
{
[ "$1" = "-a" ] && return
[ "$1" = "--all" ] && return
return 1
}
...@@ -171,7 +171,11 @@ case $CMD in ...@@ -171,7 +171,11 @@ case $CMD in
get_list "$@" get_list "$@"
exit exit
fi fi
docmd pct list "$@" if option_all "$1" ; then
docmd pct list -a
else
docmd pct list
fi
#info "See evz ports ID for print ports" #info "See evz ports ID for print ports"
;; ;;
exec) # HELPCMD: execute command by list (all for all containers) exec) # HELPCMD: execute command by list (all for all containers)
......
...@@ -137,7 +137,7 @@ case $CMD in ...@@ -137,7 +137,7 @@ case $CMD in
get_list "$@" get_list "$@"
exit exit
fi fi
if [ "$1" = "-a" ] || [ "$1" = "--all" ] ; then if option_all "$1" ; then
docmd qm list docmd qm list
else else
docmd qm list | grep running docmd qm list | grep running
......
...@@ -170,7 +170,7 @@ case $CMD in ...@@ -170,7 +170,7 @@ case $CMD in
get_list "$@" get_list "$@"
exit exit
fi fi
if [ "$1" = "-a" ] ;then if option_all "$1" ; then
docmd vboxmanage list vms docmd vboxmanage list vms
else else
docmd vboxmanage list runningvms docmd vboxmanage list runningvms
......
...@@ -129,7 +129,11 @@ case $CMD in ...@@ -129,7 +129,11 @@ case $CMD in
get_list "$@" get_list "$@"
exit exit
fi fi
a= vzlist "$@" if option_all "$1" ; then
docmd vzlist -a
else
docmd vzlist
fi
;; ;;
exec) # HELPCMD: execute command by list (all for all containers) exec) # HELPCMD: execute command by list (all for all containers)
################################### ###################################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment