#!/bin/bash # $HeadURL$ $LastChangedRevision$ # Modules . $(miniade) || { echo "${0##*/}: ERROR: miniade failed (hint: run 'miniade' to see error)" >&2; exit 1; } # Configurable stuff # Other globals main() { local MY_ARGS # Defaults for options # Process options special_opts_handler() { case $1 in --progname=*) miniade_set_progname ${1#*=} ;; *) return 1 ;; esac } miniade_process_options --help-handler=help --special-opts-handler=special_opts_handler MY_ARGS "$@" && set -- "${MY_ARGS[@]}" # Process arguments [ $# -ge 2 ] || miniade_bad_usage FUNCTION=$1 shift # Sanity checks and derivations [[ $FUNCTION =~ ^(info|internal|error|warning|debug)$ ]] || miniade_bad_usage # Guts miniade_$FUNCTION "$@" } help() { local PROGNAME miniade_get_progname PROGNAME echo "Usage: $PROGNAME [ ] [ ] " exit 0 } main "$@"