Skip to content

Commit 0278832

Browse files
committed
use red echo for error msg
1 parent 7395838 commit 0278832

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

parseOpts.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ parseOpts() {
197197

198198
[ ${#opt} -eq 1 ] && {
199199
echo "$opt" | grep -E '^[a-zA-Z0-9]$' -q || {
200-
echo "Illegal short option name($opt in $optDesc) in option description!" 1>&2
200+
_opts_redEcho "Illegal short option name($opt in $optDesc) in option description!" 1>&2
201201
_opts_cleanOptValueInfoList
202202
return 221
203203
}
@@ -254,7 +254,7 @@ parseOpts() {
254254
;;
255255
:)
256256
[ $# -lt 2 ] && {
257-
echo "Option $opt has NO value!" 1>&2
257+
_opts_redEcho "Option $opt has NO value!" 1>&2
258258
_opts_cleanOptValueInfoList
259259
return 231
260260
}
@@ -272,15 +272,15 @@ parseOpts() {
272272
} || valueArray=("${valueArray[@]}" "$value")
273273
done
274274
[ "$foundComma" ] || {
275-
echo "value of option $opt no end comma, value = ${valueArray[@]}" 1>&2
275+
_opts_redEcho "value of option $opt no end comma, value = ${valueArray[@]}" 1>&2
276276
_opts_cleanOptValueInfoList
277277
return 231
278278
}
279279
shift "$((${#valueArray[@]} + 1))"
280280
_opts_setOptArray "$optName" "${valueArray[@]}"
281281
;;
282282
*)
283-
echo "Undefined option $opt!" 1>&2
283+
_opts_redEcho "Undefined option $opt!" 1>&2
284284
_opts_cleanOptValueInfoList
285285
return 232
286286
;;

0 commit comments

Comments
 (0)