mirror of
https://github.com/koalaman/shellcheck
synced 2025-08-22 14:23:53 -07:00
changing long options with short options and K&R style
This commit is contained in:
parent
597f8c96cc
commit
a23f46249d
2 changed files with 6 additions and 8 deletions
12
nextnumber
12
nextnumber
|
@ -1,16 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
# TODO: Find a less trashy way to get the next available error code
|
||||
if ! shopt -s globstar; then
|
||||
if ! shopt -s globstar
|
||||
then
|
||||
echo "Error: This script depends on Bash 4." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for i in 1 2; do
|
||||
last=$(grep --no-filename --invert-match "^prop" ./**/*.hs \
|
||||
| grep --extended-regexp --word-regexp --only-matching "$i[0-9]{3}" \
|
||||
| sort --numeric-sort \
|
||||
| tail --lines 1
|
||||
)
|
||||
for i in 1 2
|
||||
do
|
||||
last=$(grep -hv "^prop" ./**/*.hs | grep -Ewo "$i[0-9]{3}" | sort -n | tail -n 1)
|
||||
echo "Next ${i}xxx: $((last+1))"
|
||||
done
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ if [[ $var == *$'\nTrue'* ]]
|
|||
then
|
||||
exit 0
|
||||
else
|
||||
grep --context 3 --regexp "Fail" --regexp "Tracing" <<< "${var}"
|
||||
grep -C 3 -e "Fail" -e "Tracing" <<< "${var}"
|
||||
exit 1
|
||||
fi
|
||||
) 2>&1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue