This works fine
alias moo {
var %moo = $1
goto %moo {
:cow
echo -a moo cow
return
:dog
echo -a moo dog
return
:cat
echo -a moo cat
return
:%moo
echo -a moo mouse
return
}
}
I know some will scream "abuse" but I find this more readable than a bunch of ifs. In fact, the only difference between the above and the suggested switch/case is the usage of the "goto" keyword, instead of "switch", and the absense of the "case" keyword.