diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-03-20 09:48:17 -0400 |
|---|---|---|
| committer | Who? Me?! <mark-i-m@users.noreply.github.com> | 2018-03-26 20:28:00 -0500 |
| commit | 593e6d361ff419afc56a2a594675b03bfde6e6d0 (patch) | |
| tree | d742628daddf57831411e4dfe69e47d31c3334a6 /src/doc/rustc-dev-guide | |
| parent | fd04912abdfeb3b2a93eef736a4d9e6797e90ea9 (diff) | |
| download | rust-593e6d361ff419afc56a2a594675b03bfde6e6d0.tar.gz rust-593e6d361ff419afc56a2a594675b03bfde6e6d0.zip | |
make the script give more useful feedback
Diffstat (limited to 'src/doc/rustc-dev-guide')
| -rwxr-xr-x | src/doc/rustc-dev-guide/ci/check_line_lengths.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/doc/rustc-dev-guide/ci/check_line_lengths.sh b/src/doc/rustc-dev-guide/ci/check_line_lengths.sh index b32906da68f..dc48091c873 100755 --- a/src/doc/rustc-dev-guide/ci/check_line_lengths.sh +++ b/src/doc/rustc-dev-guide/ci/check_line_lengths.sh @@ -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:" |
