From 94341e6d65c4ef4c7645f95ad40ee42f835c6069 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 15 Jun 2017 13:59:47 +1200 Subject: Clean up some exit statuses --- bin/fnl.sh | 2 +- bin/shb.sh | 6 +++--- bin/xgo.sh | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/fnl.sh b/bin/fnl.sh index 8d771adb..86e582f1 100644 --- a/bin/fnl.sh +++ b/bin/fnl.sh @@ -3,7 +3,7 @@ # Check we have at least one argument if [ "$#" -eq 0 ] ; then printf >&2 'fnl: Command needed\n' - return 2 + exit 2 fi # Create a temporary directory; note that we *don't* clean it up on exit diff --git a/bin/shb.sh b/bin/shb.sh index 7d31876d..d0279ce3 100644 --- a/bin/shb.sh +++ b/bin/shb.sh @@ -1,10 +1,10 @@ # Use PATH to build a shebang for a script given on stdin self=shb -# Need at least two arguments +# Need at least one argument if [ "$#" -lt 1 ] ; then printf >&2 '%s: Need interpreter command\n' "$self" - exit 1 + exit 2 fi # First argument is the name of the interpreter @@ -23,4 +23,4 @@ set -- "$intp" "$@" printf '#!%s\n' "$*" # Emit the rest of the input -cat +cat - diff --git a/bin/xgo.sh b/bin/xgo.sh index 4d7cf922..3fb11fde 100644 --- a/bin/xgo.sh +++ b/bin/xgo.sh @@ -3,6 +3,7 @@ # Check arguments if [ "$#" -eq 0 ] ; then printf >&2 'xgo: At least one URL required\n' + exit 2 fi # Iterate over the URL arguments -- cgit v1.2.3