summaryrefslogtreecommitdiff
path: root/tools/memory-model/scripts/parseargs.sh
diff options
context:
space:
mode:
authorPaul E. McKenney <[email protected]>2018-12-03 15:04:51 -0800
committerIngo Molnar <[email protected]>2019-01-21 11:07:04 +0100
commit910cc9591d1433c2e26bd1c210844b09c699dd89 (patch)
treeb41c7b3f333ef18e046f00398977f44a79cba550 /tools/memory-model/scripts/parseargs.sh
parentb02eb5b0961a06561b89f5b7f0dd171b750e5789 (diff)
tools/memory-model: Make scripts take "-j" abbreviation for "--jobs"
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 <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'tools/memory-model/scripts/parseargs.sh')
-rw-r--r--tools/memory-model/scripts/parseargs.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/memory-model/scripts/parseargs.sh b/tools/memory-model/scripts/parseargs.sh
index 96b307c8d64a..859e1d581e05 100644
--- a/tools/memory-model/scripts/parseargs.sh
+++ b/tools/memory-model/scripts/parseargs.sh
@@ -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
;;