make the script give more useful feedback

This commit is contained in:
Niko Matsakis 2018-03-20 09:48:17 -04:00 committed by Who? Me?!
parent b3d8fba198
commit eea5f4c3ad
1 changed files with 16 additions and 0 deletions

View File

@ -1,5 +1,21 @@
#!/bin/bash
if [ "$1" == "--help" ]; then
echo 'Usage:'
echo ' MAX_LINE_LENGTH=80' "$0" 'src/**/*.md'
exit 1
fi
if [ "$MAX_LINE_LENGTH" == "" ]; then
echo '`MAX_LINE_LENGTH` environment variable not set. Try --help.'
exit 1
fi
if [ "$1" == "" ]; then
echo 'No files provided.'
exit 1
fi
echo "Checking line lengths in all source files <= $MAX_LINE_LENGTH chars..."
echo "Offending files and lines:"