Add some error messages

This commit is contained in:
Yorick Barbanneau 2018-11-17 19:48:28 +01:00
parent 99a88d4898
commit f1054a71ca

View file

@ -50,11 +50,14 @@ function usage (){
msg "\t<arguments>**:**<code_retour_attendu>\n\n" msg "\t<arguments>**:**<code_retour_attendu>\n\n"
} }
echo " Hououuuu ${PWD}" msg "**ADSILLH Bash return code test**\n"
process_args $@ process_args $@
[[ -z $COMMAND || -z $TEST_FILE ]] && error "You must specity a command and a test file"
msg "Test $COMMAND script with $TEST_FILE\n\n" msg "Test $COMMAND script with $TEST_FILE\n\n"
cd $DIR cd $DIR
[ ! -f $COMMAND ] && error "script **$COMMAND** not found"
while IFS='' read -r i || [[ -n "$line" ]]; do while IFS='' read -r i || [[ -n "$line" ]]; do
args=$(echo $i | cut -d: -f1) args=$(echo $i | cut -d: -f1)
e_code=$(echo $i | cut -d: -f2) e_code=$(echo $i | cut -d: -f2)