From a8a7f872b133b564ea7e7a493674aefb38a81fb8 Mon Sep 17 00:00:00 2001 From: Gregory Jefferis Date: Mon, 28 Jul 2014 11:47:52 +0100 Subject: [PATCH 1/3] As far as I can see we need man cmtk- * that's what works for me on a mac --- core/scripts/cmtk.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/scripts/cmtk.in b/core/scripts/cmtk.in index 1126b83f..2d2fda01 100755 --- a/core/scripts/cmtk.in +++ b/core/scripts/cmtk.in @@ -44,7 +44,7 @@ else fi if echo "$CMD $@" | grep -q -e --help; then - [ "$CMD" = "--help" ] && man cmtk || man <( ${CMDPATH} --man ) + [ "$CMD" = "--help" ] && man cmtk || man <( cmtk-${CMDPATH} --man ) else ${CMDPATH} "$@" fi From 7adaf27cf979ac1e6f85289def0657fbaeb7e7d2 Mon Sep 17 00:00:00 2001 From: Gregory Jefferis Date: Mon, 28 Jul 2014 11:47:03 +0100 Subject: [PATCH 2/3] Add basic help for cmtk, listing binaries * does man cmtk exist? I've never seen it --- core/scripts/cmtk.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/scripts/cmtk.in b/core/scripts/cmtk.in index 2d2fda01..e8b8fe4e 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 From 91b64120bdde8b487a81b54b3be936dc43798525 Mon Sep 17 00:00:00 2001 From: Gregory Jefferis Date: Mon, 28 Jul 2014 11:49:31 +0100 Subject: [PATCH 3/3] Usually better off just using the tool's help * I guess this could be conditional on failing to find man entries for the tool in question --- core/scripts/cmtk.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/scripts/cmtk.in b/core/scripts/cmtk.in index e8b8fe4e..6ccf152e 100755 --- a/core/scripts/cmtk.in +++ b/core/scripts/cmtk.in @@ -52,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 <( cmtk-${CMDPATH} --man ) +if [ -z "$@" ] || [ "$@" = "--help" ] ; then + ${CMDPATH} "--help" else ${CMDPATH} "$@" fi