[Makefile] Exit if provided an incorrect argument

Message ID beab92e4-fcc6-5a79-03e2-082131fd3c96@arm.com
State Committed
Headers

Commit Message

Matthew Malcomson Jan. 15, 2019, 10:33 a.m. UTC
  On 15/01/19 10:03, Florian Weimer wrote:
> * Matthew Malcomson:
>
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -148,6 +148,7 @@ while test $$# -gt 0 ; do
>>         ;;
>>       --*)
>>         usage
>> +      exit 1
>>         ;;
>>       *)
>>         break
> I think you should add the exit to the usage function.
>
> Thanks,
> Florian

Makes sense -- thanks!
Fixed patch attached.

ChangeLog:

2019-01-15  Matthew Malcomson  <matthew.malcomson@arm.com>

	* Makefile (testrun.sh): Exit if provided incorrect arg.


--- Patch Inlined for ease of reply ----
  

Comments

Florian Weimer Feb. 4, 2019, 12:09 p.m. UTC | #1
* Matthew Malcomson:

> On 15/01/19 10:03, Florian Weimer wrote:
>> * Matthew Malcomson:
>>
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -148,6 +148,7 @@ while test $$# -gt 0 ; do
>>>         ;;
>>>       --*)
>>>         usage
>>> +      exit 1
>>>         ;;
>>>       *)
>>>         break
>> I think you should add the exit to the usage function.
>>
>> Thanks,
>> Florian
>
> Makes sense -- thanks!
> Fixed patch attached.

Thanks, pushed.

Florian
  

Patch

diff --git a/Makefile b/Makefile
index b4703e4..9d76d86 100644
--- a/Makefile
+++ b/Makefile
@@ -137,6 +137,7 @@  GCONV_PATH="$${builddir}/iconvdata"
 usage () {
   echo "usage: $$0 [--tool=strace] PROGRAM [ARGUMENTS...]" 2>&1
   echo "       $$0 --tool=valgrind PROGRAM [ARGUMENTS...]" 2>&1
+  exit 1
 }
 
 toolname=default