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
|
#!/usr/bin/env bash
|
||||||
# TODO: Find a less trashy way to get the next available error code
|
# 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
|
echo "Error: This script depends on Bash 4." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in 1 2; do
|
for i in 1 2
|
||||||
last=$(grep --no-filename --invert-match "^prop" ./**/*.hs \
|
do
|
||||||
| grep --extended-regexp --word-regexp --only-matching "$i[0-9]{3}" \
|
last=$(grep -hv "^prop" ./**/*.hs | grep -Ewo "$i[0-9]{3}" | sort -n | tail -n 1)
|
||||||
| sort --numeric-sort \
|
|
||||||
| tail --lines 1
|
|
||||||
)
|
|
||||||
echo "Next ${i}xxx: $((last+1))"
|
echo "Next ${i}xxx: $((last+1))"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ if [[ $var == *$'\nTrue'* ]]
|
||||||
then
|
then
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
grep --context 3 --regexp "Fail" --regexp "Tracing" <<< "${var}"
|
grep -C 3 -e "Fail" -e "Tracing" <<< "${var}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
) 2>&1
|
) 2>&1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue