#!/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 local HAD_MINUS_C # Defaults for options HAD_MINUS_C=false # Process options special_opts_handler() { case $1 in -c) HAD_MINUS_C=true ;; *) return 1 ;; esac } miniade_process_options --help-handler=help --special-opts-handler=special_opts_handler MY_ARGS "$@" && set -- "${MY_ARGS[@]}" # Process arguments [ $# = 1 ] || miniade_bad_usage # Sanity checks and derivations $HAD_MINUS_C || miniade_bad_usage # Guts miniade_info "calling [$1] ..." eval "$1" } help() { local PROGNAME miniade_get_progname PROGNAME echo "Usage: $PROGNAME [ ] -c " exit 0 } main "$@"