Commit 9d4aec7d authored by Vitaly Lipatov's avatar Vitaly Lipatov

improve list (-a,-q,ALL,all)

parent b7270d1e
...@@ -46,6 +46,7 @@ $(get_help HELPOPT) ...@@ -46,6 +46,7 @@ $(get_help HELPOPT)
Examples: Examples:
# evz start ID ID ID # evz start ID ID ID
# evz list ALL
" "
} }
...@@ -90,12 +91,12 @@ esac ...@@ -90,12 +91,12 @@ esac
list_all() list_all()
{ {
vzlist -1 vzlist -1 "$@"
} }
list_ALL() list_ALL()
{ {
vzlist -1 -a vzlist -1 -a "$@"
} }
# TODO: add all support for all cases # TODO: add all support for all cases
...@@ -143,10 +144,18 @@ case $CMD in ...@@ -143,10 +144,18 @@ case $CMD in
vzctl start $i vzctl start $i
done done
;; ;;
list) # HELPCMD: list avaiable container(s) list) # HELPCMD: list avaiable container(s) (use -q|-1 for list only ID, list ALL|-a for list ever stopped containers)
# TODO -q for just id list # if -q, just id list
# TODO -a support if [ -z "$verbose" ] || [ "$1" = "-1" ] || [ "$1" = "-q" ] ; then
# https://bugs.etersoft.ru/show_bug.cgi?id=12016 [ -z "$verbose" ] || shift
# some hack, TODO: drop all args
[ "$1" = "all" ] && shift
LIST="$(list_all "$@")"
[ "$1" = "ALL" ] && LIST="$(list_ALL)"
[ "$1" = "-a" ] && LIST="$(list_ALL)"
echo "$LIST"
exit
fi
vzlist "$@" vzlist "$@"
;; ;;
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