exit codes

This commit is contained in:
Thomas Levine 2016-04-10 19:32:01 +00:00
parent b03640f8aa
commit 2ba4c8b00e
1 changed files with 7 additions and 4 deletions

11
urchin
View File

@ -51,7 +51,6 @@ set -e
# Delimiters # Delimiters
LF="$(printf '\n')" LF="$(printf '\n')"
HT="$(printf '\t')" HT="$(printf '\t')"
DELIMITERS="[${LF}${HT}]"
# Urchin version number # Urchin version number
VERSION=0.0.0-master VERSION=0.0.0-master
@ -157,6 +156,8 @@ Exit codes have the following meanings
10 Dependencies are missing (locally, not on remotes). 10 Dependencies are missing (locally, not on remotes).
11 Flags were not valid. 11 Flags were not valid.
12 File names contain unsupported delimiters (HT or LF). 12 File names contain unsupported delimiters (HT or LF).
13 An test shell passed with -s/--shell is not available.
14 A test shell was in the PATH but failed to run.
Go to https://thomaslevine.com/!/urchin/ for documentation on writing tests. Go to https://thomaslevine.com/!/urchin/ for documentation on writing tests.
@ -613,8 +614,9 @@ main() {
urchin_exit 13 urchin_exit 13
} }
if contains "${potential_test}" "${HT}"; then if contains "${potential_test}" "${HT}" "${LF}"; then
echo 'Shell paths may not contain tab characters (HT).' >&2 echo 'Shell paths may contain all characters other than' >&2
echo 'horizontal tab (\t) and line feed (\n).' >&2
urchin_exit 11 urchin_exit 11
fi fi
@ -623,6 +625,7 @@ main() {
(usually spaces) are absent from shell paths so that (usually spaces) are absent from shell paths so that
you don't need to quote the TEST_SHELL variable." >&2 you don't need to quote the TEST_SHELL variable." >&2
fi fi
shell_list="${shell_for_sh_tests}${LF}${shell_list}" shell_list="${shell_for_sh_tests}${LF}${shell_list}"
;; ;;
-n|--disable-cycling) cycle_shell=false;; -n|--disable-cycling) cycle_shell=false;;
@ -718,7 +721,7 @@ want to run urchin on that directory.' >&2
TIMEOUT="timeout ${urchin_timeout}" TIMEOUT="timeout ${urchin_timeout}"
else else
echo I couldn\'t figure out how to use your version of timeout >&2 echo I couldn\'t figure out how to use your version of timeout >&2
urchin_exit 13 urchin_exit 10
fi fi
fi fi