From 0f291e4b7efb5ddeb86b24d81275c4d9f6e3fa14 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Fri, 1 Jun 2018 15:06:36 +1200 Subject: [PATCH] runtest: Show usage if first option starts '-' Previously we ended up passing such options to libtool, so putting -v on runtest instead of apitest like this would run the tests but -v would effectively do nothing (it would make libtool verbose, but that doesn't make any difference in this case): ./runtest -v ./apitest --- xapian-core/tests/runtest.in | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/xapian-core/tests/runtest.in b/xapian-core/tests/runtest.in index a5753110b..b78af5a7c 100644 --- a/xapian-core/tests/runtest.in +++ b/xapian-core/tests/runtest.in @@ -4,7 +4,7 @@ # Wrapper script for running test programs (using libtool, valgrind and # eatmydata if required). # -# Copyright (C) 2003,2004,2007,2008,2009,2010,2013,2017 Olly Betts +# Copyright (C) 2003,2004,2007,2008,2009,2010,2013,2017,2018 Olly Betts # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -21,12 +21,16 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 # USA -if test 0 = "$#"; then - echo "syntax: $0 []" - echo "syntax: $0 gdb []" - echo "syntax: $0 []" - exit 1 -fi +# Check for first argument starting with a '-' or no arguments and give usage +# message. +case $1:$# in + -*|*:0) + echo "syntax: $0 []" + echo "syntax: $0 gdb []" + echo "syntax: $0 []" + exit 1 + ;; +esac # Set srcdir if it isn't already. : ${srcdir="@srcdir@"} -- 2.11.4.GIT