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
fi
# Size too hard
#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}}' "$@"
info "See evz ports ID for print ports"
;;
......
......@@ -55,3 +55,10 @@ arg_is_all()
[ "$1" = "all" ] && return
return 1
}
option_all()
{
[ "$1" = "-a" ] && return
[ "$1" = "--all" ] && return
return 1
}
......@@ -171,7 +171,11 @@ case $CMD in
get_list "$@"
exit
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"
;;
exec) # HELPCMD: execute command by list (all for all containers)
......
......@@ -137,7 +137,7 @@ case $CMD in
get_list "$@"
exit
fi
if [ "$1" = "-a" ] || [ "$1" = "--all" ] ; then
if option_all "$1" ; then
docmd qm list
else
docmd qm list | grep running
......
......@@ -170,7 +170,7 @@ case $CMD in
get_list "$@"
exit
fi
if [ "$1" = "-a" ] ;then
if option_all "$1" ; then
docmd vboxmanage list vms
else
docmd vboxmanage list runningvms
......
......@@ -129,7 +129,11 @@ case $CMD in
get_list "$@"
exit
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)
###################################
......
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