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



On 2006-08-11 at 12:54 +0200, Nikolai Weibull wrote:
> I'm trying to set a default for a shell-script indentation script.

Or, if you want to be puzzled, shove a function into zsh and look at
what "zsh -f" produces.  Valid, there's logic to it, but it doesn't
match the writing style of anyone I know.  ;^)

% function foo { case $1 in (a) print alpha; print second; print third;;
	(b) print beta;; (*) print omega;;esac }

% whence -f foo
foo () {
        case $1 in
                (a) print alpha
                        print second
                        print third ;;
                (b) print beta ;;
                (*) print omega ;;
        esac
}

The same output comes if you spread things out more when entering it.
So the first line of the action is always shown inline with the
conditional value and the subsequent lines are indented further.
-- 
VISTA: Viruses, Infections, Spyware, Trojans & Adware



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