Commit cad1e022 authored by Bruce Momjian's avatar Bruce Momjian

pgindent: add --list-of-typedefs option

Allows typedefs to be specified on the command line, per request from
Andrew.
parent a87ae38b
...@@ -22,10 +22,11 @@ my $indent_opts = ...@@ -22,10 +22,11 @@ my $indent_opts =
# indent-dependant settings # indent-dependant settings
my $extra_opts = ""; my $extra_opts = "";
my ($typedefs_file, $code_base, $excludes, $indent, $build); my ($typedefs_file, $typedef_str, $code_base, $excludes, $indent, $build);
my %options = ( my %options = (
"typedefs=s" => \$typedefs_file, "typedefs=s" => \$typedefs_file,
"list-of-typedefs=s" => \$typedef_str,
"code-base=s" => \$code_base, "code-base=s" => \$code_base,
"excludes=s" => \$excludes, "excludes=s" => \$excludes,
"indent=s" => \$indent, "indent=s" => \$indent,
...@@ -125,6 +126,13 @@ sub load_typedefs ...@@ -125,6 +126,13 @@ sub load_typedefs
|| die "cannot open typedefs file \"$typedefs_file\": $!\n"; || die "cannot open typedefs file \"$typedefs_file\": $!\n";
my @typedefs = <$typedefs_fh>; my @typedefs = <$typedefs_fh>;
close($typedefs_fh); close($typedefs_fh);
if (defined($typedef_str))
{
foreach my $typedef (split(m/[, \t\n]+/, $typedef_str))
{
push(@typedefs, $typedef . "\n");
}
}
# remove certain entries # remove certain entries
@typedefs = @typedefs =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment