OSDN Git Service

The default of the object queue clear is changed to Q-QUEUE.
authorNIWA Hideyuki <niwa.hideyuki@jp.fujitsu.com>
Mon, 5 May 2014 07:39:17 +0000 (16:39 +0900)
committerNIWA Hideyuki <niwa.hideyuki@jp.fujitsu.com>
Mon, 5 May 2014 07:39:17 +0000 (16:39 +0900)
All queues were cleared so far.
Q-QUEUE is cleared when not is being specified the queue by the argument.

lxcf/lib/lxcf-queue-clear

index 9682df8..0e00c03 100755 (executable)
@@ -28,23 +28,30 @@ fi
 
 # 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