| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 | #!/bin/bash
. <(ffoom init)
export FFOO_INI_PATH="__SATURNIN_INI_PATH__:$SATURNIN_INI_PATH"
saturnin_libexec="__SATURNIN_LIBEXEC__"
ffoo import exit
ffoo import core
usage() {
    usage_is "[-d|-v] command [args...]" \
             "help"
}
print_help() {
    echo "valid commands:"
    echo ""
    echo "   czrates"
    echo "   dmenu"
    echo "   iam"
    echo "   ini"
    echo "   ip"
    echo "   ln"
    echo "   push"
    echo "   revert"
    echo "   watch"
    echo "   www"
}
while true; do case $1 in
    -d|--debug)     export FFOO_DEBUG=true; shift   ;;
    -v|--verbose)   export FFOO_VERBOSE=true; shift ;;
    --)             shift; break                    ;;
    "")             usage;                          ;;
    *)              break;                          ;;
esac done
debug "\$@=$@"
scmd=$1
shift
case $scmd in
    help)  print_help; exit $FFOO_EXIT_OK ;;
    *)
        lexpath="$saturnin_libexec/saturnin-$scmd"
        debug -v lexpath
        debug "\$@='$@'"
        test -x "$lexpath" && exec "$lexpath" "$@"
        warn "invalid sub-command: $scmd"
        print_help; exit $FFOO_EXIT_USAGE
        ;;
esac
 |