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 1q2AtT-000839-3N for pgsql-hackers@arkaria.postgresql.org; Thu, 25 May 2023 13:20:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q2AtR-0005yX-W4 for pgsql-hackers@arkaria.postgresql.org; Thu, 25 May 2023 13:20:37 +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 1q2AtR-0005yG-NR for pgsql-hackers@lists.postgresql.org; Thu, 25 May 2023 13:20:37 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q2AtO-0024nG-IP for pgsql-hackers@postgresql.org; Thu, 25 May 2023 13:20:37 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 34PDKW4X1471231; Thu, 25 May 2023 09:20:32 -0400 From: Tom Lane To: Peter Eisentraut cc: pgsql-hackers Subject: Re: pgindent vs. pgperltidy command-line arguments In-reply-to: <45aacd8a-5265-d9da-8df2-b8e2c0cf6a07@eisentraut.org> References: <45aacd8a-5265-d9da-8df2-b8e2c0cf6a07@eisentraut.org> Comments: In-reply-to Peter Eisentraut message dated "Thu, 25 May 2023 11:10:48 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1471229.1685020832.1@sss.pgh.pa.us> Date: Thu, 25 May 2023 09:20:32 -0400 Message-ID: <1471230.1685020832@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > Until PG15, calling pgindent without arguments would process the whole > tree. Now you get > No files to process at ./src/tools/pgindent/pgindent line 372. > Is that intentional? It was intentional, cf b16259b3c and the linked discussion. > Also, pgperltidy accepts no arguments and always processes the whole > tree. It would be nice if there were a way to process individual files > or directories, like pgindent can. +1, although I wonder if we shouldn't follow pgindent's new lead and require some argument(s). > Attached is a patch for this. > (It seems that it works ok to pass regular files (not directories) to > "find", but I'm not sure if it's portable.) The POSIX spec for find(1) gives an example of applying find to what they evidently intend to be a plain file: if [ -n "$(find file1 -prune -newer file2)" ]; then printf %s\\n "file1 is newer than file2" fi So while I don't see it written in so many words, I think you can assume it's portable. regards, tom lane