#!/bin/sh

# Run a khmer command
# Note silly sh-compatible way of testing if arg starts with -
if [ "$1" = "" -o "${1#-}" != "$1" ] ; then
    cat <<.
Usage: khmer <script> [args]
       khmer <script> --help

If you want to run the scripts directly, as per the khmer documentation,
modify your PATH like so:
 export PATH="/usr/lib/khmer/bin:\$PATH"

Scripts available:
.
ls /usr/lib/khmer/bin/*.py | sed 's/.*\//  /;s/\.py$//'
exit 1
fi


# Set environment
export PATH="$PATH:/usr/lib/khmer/bin"

cmd=`basename "$1" .py`.py
shift

exec "/usr/lib/khmer/bin/$cmd" "$@"
