Re: pgsql: Use $INDENT rather than indent throughout the pgindent code - Mailing list pgsql-committers

From Alvaro Herrera
Subject Re: pgsql: Use $INDENT rather than indent throughout the pgindent code
Date
Msg-id 1298043768-sup-8005@alvh.no-ip.org
Whole thread Raw
In response to Re: pgsql: Use $INDENT rather than indent throughout the pgindent code  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: Use $INDENT rather than indent throughout the pgindent code  (Andrew Dunstan <andrew@dunslane.net>)
Re: pgsql: Use $INDENT rather than indent throughout the pgindent code  (Bruce Momjian <bruce@momjian.us>)
List pgsql-committers
Excerpts from Tom Lane's message of vie feb 18 00:34:33 -0300 2011:
> Bruce Momjian <bruce@momjian.us> writes:
> > Andrew Dunstan wrote:
> >> On 02/17/2011 08:23 PM, Alvaro Herrera wrote:
> >>> Use $INDENT rather than indent throughout the pgindent code
> >>> +INDENT=`which indent`
>
> >> How universally available is "which"?
>
> > I have 'which'.  I am unclear how 'which' helps in this case.

Hey, you could have asked when I showed you the patch yesterday on IM.

> It doesn't.  Anything 'which' would find could perfectly well be invoked
> by saying plain old "indent".

It helps because I can easily change the value in the script in a single
place to what I want.  That's a bit less inconvenient than having to
edit more than one place.  However ...

> What would actually be useful here is a
> convenient way to override the script's default value of INDENT, but
> this coding doesn't offer that.  I'd suggest something more like
>
> if [ -z "$INDENT" ]; then
>   INDENT=indent
> fi

... this is certainly better.  I'll change it to this.

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-committers by date:

Previous
From: Simon Riggs
Date:
Subject: pgsql: Make a hard state change from catchup to streaming mode.
Next
From: Alvaro Herrera
Date:
Subject: pgsql: Use $INDENT instead of `which` to find the indent binary