mirror of
https://github.com/sstephenson/bats.git
synced 2026-02-26 01:38:11 +01:00
bats -c filename prints the number of tests in the file
This commit is contained in:
10
libexec/bats
10
libexec/bats
@@ -40,14 +40,20 @@ if [ "$1" = "-v" ] || [ "$1" = "--version" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
count_only=""
|
||||
if [ "$1" = "-c" ]; then
|
||||
count_only="-c"
|
||||
shift
|
||||
fi
|
||||
|
||||
filename="$1"
|
||||
if [ -z "$filename" ]; then
|
||||
{ version
|
||||
echo "usage: $0 <filename>"
|
||||
echo "usage: $0 [-c] <filename>"
|
||||
} >&2
|
||||
exit 1
|
||||
else
|
||||
shift
|
||||
fi
|
||||
|
||||
exec bats-exec "$(expand_path "$filename")" "$@"
|
||||
exec bats-exec $count_only "$(expand_path "$filename")" "$@"
|
||||
|
||||
Reference in New Issue
Block a user