This commit is contained in:
Emma Tebibyte 2022-11-12 01:22:37 -05:00
parent 1f8d301103
commit 1bdfb798ea
1 changed files with 7 additions and 1 deletions

View File

@ -2,11 +2,17 @@
set -e
# check usage
if ! test -n "$1"; then
printf "Usage: %s [path...]\n" "$0" 1>&2
exit 64 # sysexits(3) EX_USAGE
fi
# check if we have rg(1)
if ! command -v rg >/dev/null 2>&1; then
printf "%s: Missing dependency: rg(1)\n" "$0" 1>&2
exit 69 # sysexits(3) EX_UNAVAILABLE
else
rg --multiline --files-without-match --glob '*.rs' --pcre2 \
rg --multiline --files-without-match --glob "$1" --pcre2 \
'(?<!\n)((//)|(#)) Copyright \(c\) \d+ [A-z, ]+\n((//)|(#)) SPDX-License-Identifier: .*\n'
fi