From d3d4a52c66773529b10bc826568df78a2cba91b4 Mon Sep 17 00:00:00 2001
From: Jelte Fennema-Nio <postgres@jeltef.nl>
Date: Tue, 3 Mar 2026 20:56:15 +0100
Subject: [PATCH v4 2/7] pgindent: Default to indenting the current directory
 if no files are given

Previously running pgindent without giving it any files would result in
this output:

src/tools/pgindent/pgindent
No files to process at src/tools/pgindent/pgindent line 526.

This instead indents the current directory, which is probably what the
user intended.
---
 src/tools/pgindent/pgindent | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/tools/pgindent/pgindent b/src/tools/pgindent/pgindent
index f5bc4b3642a..e2e6f19678a 100755
--- a/src/tools/pgindent/pgindent
+++ b/src/tools/pgindent/pgindent
@@ -63,6 +63,9 @@ usage() if $help;
 usage("Cannot use --commit with command line file list")
   if (@commits && @ARGV);
 
+# default to current directory if no files/dirs given
+@ARGV = ('.') unless @ARGV || @commits;
+
 # command line option wins, then environment, then locations based on current
 # dir, then default location
 $typedefs_file ||= $ENV{PGTYPEDEFS};
-- 
2.53.0

