Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lH6eO-0001tQ-5H for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Mar 2021 15:09:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lH6eN-0001kF-32 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Mar 2021 15:09:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lH6eM-0001k8-Sy for pgsql-hackers@lists.postgresql.org; Tue, 02 Mar 2021 15:09:26 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lH6eJ-0001Qs-V7 for pgsql-hackers@postgresql.org; Tue, 02 Mar 2021 15:09:26 +0000 Received: from hnk.local (p2386004-ipbf1026funabasi.chiba.ocn.ne.jp [118.6.4.4]) by oss.nttdata.com (Postfix) with ESMTPSA id EA4776278B; Wed, 3 Mar 2021 00:09:18 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com Subject: Re: [PATCH] psql : Improve code for help option To: miyake_kouta , Pgsql Hackers References: <2a3c612babdd6ed63a9d877bb575d793@oss.nttdata.com> From: Fujii Masao Message-ID: <88126881-c90e-e3c1-9878-5a1788dec026@oss.nttdata.com> Date: Wed, 3 Mar 2021 00:09:18 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <2a3c612babdd6ed63a9d877bb575d793@oss.nttdata.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2021/03/02 11:57, miyake_kouta wrote: > Hi. > > I found some redundant code in psql/help.c, so I propose a patch to fix it. > In the current help.c, the variable "user" is set to the value of $PGUSER (or get_user_name). > However, $PGUSER is referenced again in the code that follows. > We can replace this part with "user", I think. Good catch! > fprintf(output, _(" -U, --username=USERNAME database user name (default: \"%s\")\n"), env); We can simplify the code more and remove "env = user" by just using "user" instead of "env" in the above? Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION