parse options to regress.t
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 9 Sep 2019 21:00:12 +0000 (23:00 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 9 Sep 2019 22:37:53 +0000 (00:37 +0200)
Reserve any parameters starting with a dash.
Show usage for unknown commands ie everything.

t/regress.t

index 5daf496eb2a91b1ee916c16c8744fe9c3b2eaaf5..099b944632d4166f22891e1bdc55fec56a727907 100755 (executable)
@@ -7,6 +7,13 @@ test_count=0
 COLUMNS=40
 diffcmd='diff --unchanged-line-format= --old-line-format=<%L --new-line-format=>%L'
 
+for option in "$@"
+do
+       case "$option" in
+       -*) echo "Usage: $0 [<files>...]"; exit 64;;
+       esac
+done
+
 for candidate in ${@:-t*.in}
 do
        test_count=$((test_count+1))