On Fri, Jul 23, 2021, at 4:53 PM, lisa-asket@perso.be wrote:
> From: Lawrence Velázquez <vq@larryv.me>
>
> This wouldn't fix anything. The `warn` variable would still only
> get set when '-w' or '--warning' is passed to your function.
>
> ---
>
> Correct. Warn is only used so that some lines are coloured in red.
So. What. Is. The. Problem.
> I do not think `(*)` is called when having just `-w`.
It is. You can verify this trivially.
("-w"|"--warning")
case "$2" in
(+([[:digit:]]))
local warn="$2"
shift 2
;;
(*)
+ printf 'warned!\n' >&2
local warn="1"
shift 2
;;
esac
declare -i local f=1
;;
> I don't understand what you want at all. Isn't the current behavior
> fine? Why would you want `warn` to be set by default? What is the
> behavior you are seeing, and what are you expecting instead?
Answer these questions.
--
vq