Skip to content

Commit cad1e02

Browse files
committed
pgindent: add --list-of-typedefs option
Allows typedefs to be specified on the command line, per request from Andrew.
1 parent a87ae38 commit cad1e02

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/tools/pgindent/pgindent

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ my $indent_opts =
2222
# indent-dependant settings
2323
my $extra_opts = "";
2424

25-
my ($typedefs_file, $code_base, $excludes, $indent, $build);
25+
my ($typedefs_file, $typedef_str, $code_base, $excludes, $indent, $build);
2626

2727
my %options = (
2828
"typedefs=s" => \$typedefs_file,
29+
"list-of-typedefs=s" => \$typedef_str,
2930
"code-base=s" => \$code_base,
3031
"excludes=s" => \$excludes,
3132
"indent=s" => \$indent,
@@ -125,6 +126,13 @@ sub load_typedefs
125126
|| die "cannot open typedefs file \"$typedefs_file\": $!\n";
126127
my @typedefs = <$typedefs_fh>;
127128
close($typedefs_fh);
129+
if (defined($typedef_str))
130+
{
131+
foreach my $typedef (split(m/[, \t\n]+/, $typedef_str))
132+
{
133+
push(@typedefs, $typedef . "\n");
134+
}
135+
}
128136

129137
# remove certain entries
130138
@typedefs =

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy