Skip to content

Commit c3ea84d

Browse files
author
Damian Rouson
committed
fix #717 - cafrun shows usage info if invalid args
1 parent 5853542 commit c3ea84d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/extensions/cafrun.in

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ usage() {
155155
echo " --version, -v, -V Report version and copyright information"
156156
echo " --wraps, -w, Report info about the wrapped MPI launcher"
157157
echo " -np <N>, Number of images, N, to execute, N must be a positive integer"
158+
echo " -n <N>, Same as -np"
158159
echo " --reenable-auto-cleanup Turn off failed images support (if library support is present)"
159160
echo " This option re-enables MPI auto cleanup, which is disabled by"
160161
echo " by default if GFortran/OpenCoarrays/MPI all support failed"
@@ -168,6 +169,7 @@ usage() {
168169
echo ""
169170
echo " Example usage:"
170171
echo ""
172+
echo " ${cmd} -n 2 foo"
171173
echo " ${cmd} -np 2 foo foo_arg1 foo_arg2"
172174
echo " ${cmd} -v"
173175
echo " ${cmd} --help"
@@ -274,7 +276,8 @@ elif [[ "${1}" == -np || "${1}" == -n ]]; then
274276
exit "${return_code}"
275277
fi
276278
else
277-
echo "You must pass \"-np\", \"<number_of_images>\", \"/path/to/coarray_Fortran_program\" as the first 3 arguments to ${cmd}."
278-
exit 1
279+
usage
279280
fi
281+
else
282+
usage
280283
fi

0 commit comments

Comments
 (0)