Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
smpirun: gracefuly handle the case where the user forgets to give a program to execute
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 7 Feb 2017 10:24:09 +0000 (11:24 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 7 Feb 2017 10:24:09 +0000 (11:24 +0100)
src/smpi/smpirun.in

index 9e5689e..28ae8b0 100755 (executable)
@@ -241,6 +241,13 @@ while true; do
     esac
 done
 
     esac
 done
 
+# check if we still have at least one parameter beyond options
+if [ $# -eq 0 ]
+then
+    usage
+    exit
+fi
+
 if [ -n "$WRAPPER" ]; then
     EXEC="$WRAPPER $1"
 else
 if [ -n "$WRAPPER" ]; then
     EXEC="$WRAPPER $1"
 else