Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: What would you say is the most-used way of indenting case labels
- X-seq: zsh-users 10592
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- Subject: Re: What would you say is the most-used way of indenting case labels
- Date: Sat, 12 Aug 2006 09:44:10 -0700
- Cc: Zsh Users' List <zsh-users@xxxxxxxxxx>
- In-reply-to: <200608111937.k7BJbfE6003802@xxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <phil.pennock@xxxxxxxxxxx> <20060811142225.GA15429@xxxxxxxxxxxxxxxxxxxxx> <200608111937.k7BJbfE6003802@xxxxxxxxxxxxxxxxx>
On Fri, Aug 11, 2006 at 08:37:41PM +0100, Peter Stephenson wrote:
> Time for some audience participation. Do you prefer the following
> style? [...]
I like the case labels to be less indented than the code that follows.
I personally put them at the same level as the case, and only include a
statement on the same line if all the labels are really short and the
commands a one-liner, so in the general case I'd separate them:
foo () {
case $1 in
(a)
print alpha
print second
print third
;;
(b)
print beta
;;
(*)
print omega
;;
esac
}
I also like a 4-character indent. That's my preference...
..wayne..
Messages sorted by:
Reverse Date,
Date,
Thread,
Author