12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #!/bin/bash
-
- . <(ffoom init)
- export FFOO_INI_PATH="$SATURNIN_INI_PATH:__SATURNIN_INI_PATH__"
- export FFOO_PATH="__SATURNIN_FFOO_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 ""
- ls "$saturnin_libexec" \
- | sed -e 's/saturnin-/ /'
- }
-
- 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
|