c34ab9a28379 — Chris Cannam 5 months ago
Consistent exit codes
5 files changed, 6 insertions(+), 3 deletions(-)

M mlb-dependencies
M mlb-expand
M polyrun
M smlbuild-include.sh
M smlrun
M mlb-dependencies +1 -1
@@ 12,7 12,7 @@ arg="$1"
 if [ -z "$arg" ]; then
     echo "Usage: $0 file.sml" 1>&2
     echo "       $0 file.mlb" 1>&2
-    exit 1
+    exit 2
 fi
 
 set -u

          
M mlb-expand +1 -0
@@ 11,6 11,7 @@ arg="$1"
 
 if [ -z "$arg" ]; then
     echo "Usage: $0 file.mlb" 1>&2
+    exit 2
 fi
 
 set -u

          
M polyrun +1 -1
@@ 11,7 11,7 @@ arg="$1"
 if [ -z "$arg" ]; then
     echo "Usage: $0 file.sml" 1>&2
     echo "       $0 file.mlb" 1>&2
-    exit 1
+    exit 2
 fi
 
 shift

          
M smlbuild-include.sh +2 -0
@@ 54,6 54,8 @@ cat_mlb() {
         fi
 	local trimmed
 	trimmed=$(
+            # Tell shellcheck that the $-variables in single-quotes
+            # are not intended for bash to expand
 	    # shellcheck disable=SC2016
 	    echo "$line" |
                 # remove ML-style comments; expand library path;

          
M smlrun +1 -1
@@ 26,7 26,7 @@ if [ -z "$arg" ]; then
     echo "       $0 [-v] file.mlb" 1>&2
     echo " where" 1>&2
     echo "   -v: Do not suppress output from interactive environment" 1>&2
-    exit 1
+    exit 2
 fi
 
 shift