All queues were cleared so far.
Q-QUEUE is cleared when not is being specified the queue by the argument.
# check args
FLG_H=0
-FLG_Q=0
+FLG_Q=1
FLG_L=0
-FLG_ALL=1
+FLG_ALL=0
-while getopts hql OPT
+while getopts hqla OPT
do
case $OPT in
- "h" ) FLG_H=1 ; FLG_ALL=0 ;;
- "q" ) FLG_Q=1 ; FLG_ALL=0 ;;
- "l" ) FLG_L=1 ; FLG_ALL=0 ;;
+ "h" ) FLG_H=1 ; FLG_Q=0 ;;
+ "q" ) FLG_Q=1 ;;
+ "l" ) FLG_L=1 ; FLG_Q=0 ;;
+ "a" ) FLG_ALL=1 ; FLG_Q=0 ;;
+ \? ) OPT_ERROR=1; break;;
esac
done
shift `expr $OPTIND - 1`
+if [ $OPT_ERROR ]; then
+ echo "usage: lxcf queue clear [-h] [-q] [-l] [-a]"
+ exit 1
+fi
+
# check args
if [ $# -ne 0 ]; then
- echo "usage: lxcf queue clear [-h] [-q] [-l] "
+ echo "usage: lxcf queue clear [-h] [-q] [-l] [-a]"
exit 1
fi