[email protected] writes:
> + while test "$#" != 0
> + do
> + case "$1" in
> + auto) echo '*.txt text=auto' ;;
> + i) echo '* ident' ;;
> + text) echo '*.txt text' ;;
> + -text) echo '*.txt -text' ;;
> + crlf) echo '*.txt eol=crlf' ;;
> + lf) echo '*.txt eol=lf' ;;
> + "") echo '' ;;
> + *)
> + echo >&2 invalid attribute: $attr
> + exit 1
> + ;;
Perhaps use the right style as you are rewriting pretty much
everything in this helper function? case/esac aligns with the
labels of case arms, and commands under each arm are indented one
level down, i.e.
case "$var" in
$arm1) ... do short thing ...;;
$arm2)
... do a lot of
... things
;;
esac
I still do not see the value of accepting a cryptic 'i' (or an empty
string) to this thing, though. Also what $attr does the error
message refer to now? Perhaps it wants to refer to "$1" (quoted)
instead?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html