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

(prefix case terminators?) Re: alias with a parameter



> However you really don't need that test at all:
> case "$1" in
>   ("") false;;
>   ([A-Z]|V<->|G*);;
>   (*) echo "Yes expand";;
> esac

i would have written ${1-} so -u can be used.

also: i really think that using terminators as "continuation"
ease the code reading because

* it makes code more aligned
* it's easier to spot a different terminator than ;;

case "${1-}"
    in ('')     do_nothing
    ;; (hello*) greetings
    ;| (*world) greetings # twice
    ;; (long)
        multiple commands
        comes in indented lines
    ;;
esac

regards
marc




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