pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: miyake_kouta <miyake_kouta@oss.nttdata.com>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] psql : Improve code for help option
Date: Wed, 03 Mar 2021 12:27:11 +0900
Message-ID: <b4f7893d8fa5df110b2bfed39e89e501@oss.nttdata.com> (raw)
In-Reply-To: <88126881-c90e-e3c1-9878-5a1788dec026@oss.nttdata.com>
References: <2a3c612babdd6ed63a9d877bb575d793@oss.nttdata.com>
	<88126881-c90e-e3c1-9878-5a1788dec026@oss.nttdata.com>

2021-03-03 00:09, Fujii Masao wrote:
> We can simplify the code more and remove "env = user"
> by just using "user" instead of "env" in the above?

Thank you for your comment.
I updated my patch and replaced "env" with "user".
Please check.

Regards.
--
Kota Miyake

Attachments:

v02_psql_help.patch (text/x-diff, 810B) download diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c index e44120bf76..edb17ed5dc 100644 --- a/src/bin/psql/help.c +++ b/src/bin/psql/help.c @@ -133,11 +133,7 @@ usage(unsigned short int pager) env = getenv("PGPORT"); fprintf(output, _(" -p, --port=PORT database server port (default: \"%s\")\n"), env ? env : DEF_PGPORT_STR); - /* Display default user */ - env = getenv("PGUSER"); - if (!env) - env = user; - fprintf(output, _(" -U, --username=USERNAME database user name (default: \"%s\")\n"), env); + fprintf(output, _(" -U, --username=USERNAME database user name (default: \"%s\")\n"), user); fprintf(output, _(" -w, --no-password never prompt for password\n")); fprintf(output, _(" -W, --password force password prompt (should happen automatically)\n"));

view thread (6+ messages)  latest in thread

Message-ID: <b4f7893d8fa5df110b2bfed39e89e501@oss.nttdata.com>
Permalink:  ../b4f7893d8fa5df110b2bfed39e89e501@oss.nttdata.com/
Also on:    postgresql.org/message-id/b4f7893d8fa5df110b2bfed39e89e501@oss.nttdata.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: miyake_kouta@oss.nttdata.com, masao.fujii@oss.nttdata.com
  Subject: Re: [PATCH] psql : Improve code for help option
  In-Reply-To: <b4f7893d8fa5df110b2bfed39e89e501@oss.nttdata.com>
  References: <2a3c612babdd6ed63a9d877bb575d793@oss.nttdata.com> <88126881-c90e-e3c1-9878-5a1788dec026@oss.nttdata.com> <b4f7893d8fa5df110b2bfed39e89e501@oss.nttdata.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox