about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-03-20 09:48:17 -0400
committerWho? Me?! <mark-i-m@users.noreply.github.com>2018-03-26 20:28:00 -0500
commit593e6d361ff419afc56a2a594675b03bfde6e6d0 (patch)
treed742628daddf57831411e4dfe69e47d31c3334a6 /src/doc/rustc-dev-guide
parentfd04912abdfeb3b2a93eef736a4d9e6797e90ea9 (diff)
downloadrust-593e6d361ff419afc56a2a594675b03bfde6e6d0.tar.gz
rust-593e6d361ff419afc56a2a594675b03bfde6e6d0.zip
make the script give more useful feedback
Diffstat (limited to 'src/doc/rustc-dev-guide')
-rwxr-xr-xsrc/doc/rustc-dev-guide/ci/check_line_lengths.sh16
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:"