diff --git a/bin/miaou-bash b/bin/miaou-bash index 88c7608..99f3f43 100755 --- a/bin/miaou-bash +++ b/bin/miaou-bash @@ -613,6 +613,7 @@ function usage { function parse_options { [[ $# == 0 ]] && >&2 echo 'ERROR: script expected!' && builtin exit 2 + if [[ $# == 1 ]]; then case "$1" in --help) usage && builtin exit ;; @@ -622,6 +623,7 @@ function parse_options { -*) >&2 echo "ERROR: option '$1' unknown!" && usage && builtin exit 2 ;; esac fi + [[ $1 =~ ^- ]] && >&2 echo "ERROR: too many args $#, either single option or SCRIPT + args accepted!" && builtin exit 2 SCRIPT="$1" [[ ! -v SCRIPT ]] && >&2 echo 'ERROR: script expected!' && builtin exit 2 @@ -629,6 +631,10 @@ function parse_options { true } +function read { + 2>&1 builtin read "$@" +} + ## main set -euo pipefail