diff --git a/core/scripts/cmtk.in b/core/scripts/cmtk.in index 1126b83f..6ccf152e 100755 --- a/core/scripts/cmtk.in +++ b/core/scripts/cmtk.in @@ -34,6 +34,15 @@ export CMTK_BINARY_DIR=${CMTK_BINARY_DIR:-@CMTK_BINARY_DIR_CONFIG@} export CMTK_LIBRARY_DIR=${CMTK_BINARY_DIR:-@CMTK_LIBRARY_DIR_CONFIG@} CMD=$1 + +# Basic help if we have been called without command or cmtk --help +if [ -z "$1" ] || [ "$1" = "--help" ] ; then + echo "CMTK makes the following commands available:" + ls "${CMTK_BINARY_DIR}" + echo -e "For help on a specific command, try:\n cmtk --help" + exit 1 +fi + CMDPATH=${CMTK_BINARY_DIR}/$CMD shift @@ -43,8 +52,8 @@ else export LD_LIBRARY_PATH=${CMTK_LIBRARY_DIR} fi -if echo "$CMD $@" | grep -q -e --help; then - [ "$CMD" = "--help" ] && man cmtk || man <( ${CMDPATH} --man ) +if [ -z "$@" ] || [ "$@" = "--help" ] ; then + ${CMDPATH} "--help" else ${CMDPATH} "$@" fi