Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Possible bug: Zsh function does not terminate when ${name:?word} fails



(See also for a complete discussion:
http://stackoverflow.com/questions/39463547/zsh-function-does-not-terminate-when-nameword-fails?noredirect=1#comment66276136_39463547)

I have in my .zshrc the following function definition (simplified
example):

function foo {
  local p=${1:?parameter missing}
  echo continue ....
}

Running the function by just typing foo produces, as expected, the
message parameter missing, but it also outputs continue. I had expected
that the function terminates when the :? check fails, but it continues
to run.

I tested this with zsh 5.1.1, but I was informed that this behaviour
also can be reproduced with zsh 5.2

Ronald



Messages sorted by: Reverse Date, Date, Thread, Author