]> www.infradead.org Git - users/willy/linux.git/commitdiff
EXP tools/memory-model: Make scripts take "-j" abbreviation for "--jobs"
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Fri, 17 Aug 2018 21:41:03 +0000 (14:41 -0700)
committerPaul E. McKenney <paulmck@linux.ibm.com>
Fri, 9 Nov 2018 05:56:11 +0000 (21:56 -0800)
The "--jobs" argument to the litmus-test scripts is similar to the "-jN"
argument to "make", so this commit allows the "-jN" form as well.  While
in the area, it also prohibits the various forms of "-j0".

Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
tools/memory-model/scripts/parseargs.sh

index 96b307c8d64a14aa267c45aa6c130c05d752b1ba..859e1d581e0511ff01fd1a5f6170a80d02c5fbbd 100755 (executable)
@@ -95,8 +95,18 @@ do
                LKMM_HERD_OPTIONS="$2"
                shift
                ;;
-       --jobs|--job)
-               checkarg --jobs "(number)" "$#" "$2" '^[0-9]\+$' '^--'
+       -j[1-9]*)
+               njobs="`echo $1 | sed -e 's/^-j//'`"
+               trailchars="`echo $njobs | sed -e 's/[0-9]\+\(.*\)$/\1/'`"
+               if test -n "$trailchars"
+               then
+                       echo $1 trailing characters "'$trailchars'"
+                       usagehelp
+               fi
+               LKMM_JOBS="`echo $njobs | sed -e 's/^\([0-9]\+\).*$/\1/'`"
+               ;;
+       --jobs|--job|-j)
+               checkarg --jobs "(number)" "$#" "$2" '^[1-9][0-9]\+$' '^--'
                LKMM_JOBS="$2"
                shift
                ;;