From 109cf1947ff29307c7f1f2042ccb0ba047647ab2 Mon Sep 17 00:00:00 2001 From: pvincent Date: Fri, 7 Aug 2026 23:20:07 +0400 Subject: [PATCH] function read 2>&1 --- bin/miaou-bash | 6 ++++++ 1 file changed, 6 insertions(+) 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