|
|
@ -64,6 +64,7 @@ struct _helpStruct |
|
|
|
{ |
|
|
|
{ |
|
|
|
const char *cmd; /* the command name */ |
|
|
|
const char *cmd; /* the command name */ |
|
|
|
const char *help; /* the help associated with it */ |
|
|
|
const char *help; /* the help associated with it */ |
|
|
|
|
|
|
|
const char *docbook_id; /* DocBook XML id (for generating URL) */ |
|
|
|
void (*syntaxfunc)(PQExpBuffer); /* function that prints the syntax associated with it */ |
|
|
|
void (*syntaxfunc)(PQExpBuffer); /* function that prints the syntax associated with it */ |
|
|
|
int nl_count; /* number of newlines in syntax (for pager) */ |
|
|
|
int nl_count; /* number of newlines in syntax (for pager) */ |
|
|
|
}; |
|
|
|
}; |
|
|
@ -92,7 +93,7 @@ my %entries; |
|
|
|
|
|
|
|
|
|
|
|
foreach my $file (sort readdir DIR) |
|
|
|
foreach my $file (sort readdir DIR) |
|
|
|
{ |
|
|
|
{ |
|
|
|
my (@cmdnames, $cmddesc, $cmdsynopsis); |
|
|
|
my ($cmdid, @cmdnames, $cmddesc, $cmdsynopsis); |
|
|
|
$file =~ /\.sgml$/ or next; |
|
|
|
$file =~ /\.sgml$/ or next; |
|
|
|
|
|
|
|
|
|
|
|
open(my $fh, '<', "$docdir/$file") or next; |
|
|
|
open(my $fh, '<', "$docdir/$file") or next; |
|
|
@ -104,6 +105,9 @@ foreach my $file (sort readdir DIR) |
|
|
|
m!<refmiscinfo>\s*SQL - Language Statements\s*</refmiscinfo>!i |
|
|
|
m!<refmiscinfo>\s*SQL - Language Statements\s*</refmiscinfo>!i |
|
|
|
or next; |
|
|
|
or next; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$filecontent =~ m!<refentry id="([a-z-]+)">! |
|
|
|
|
|
|
|
and $cmdid = $1; |
|
|
|
|
|
|
|
|
|
|
|
# Collect multiple refnames |
|
|
|
# Collect multiple refnames |
|
|
|
LOOP: |
|
|
|
LOOP: |
|
|
|
{ |
|
|
|
{ |
|
|
@ -116,7 +120,7 @@ foreach my $file (sort readdir DIR) |
|
|
|
$filecontent =~ m!<synopsis>\s*(.+?)\s*</synopsis>!is |
|
|
|
$filecontent =~ m!<synopsis>\s*(.+?)\s*</synopsis>!is |
|
|
|
and $cmdsynopsis = $1; |
|
|
|
and $cmdsynopsis = $1; |
|
|
|
|
|
|
|
|
|
|
|
if (@cmdnames && $cmddesc && $cmdsynopsis) |
|
|
|
if (@cmdnames && $cmddesc && $cmdid && $cmdsynopsis) |
|
|
|
{ |
|
|
|
{ |
|
|
|
s/\"/\\"/g foreach @cmdnames; |
|
|
|
s/\"/\\"/g foreach @cmdnames; |
|
|
|
|
|
|
|
|
|
|
@ -144,6 +148,7 @@ foreach my $file (sort readdir DIR) |
|
|
|
foreach my $cmdname (@cmdnames) |
|
|
|
foreach my $cmdname (@cmdnames) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$entries{$cmdname} = { |
|
|
|
$entries{$cmdname} = { |
|
|
|
|
|
|
|
cmdid => $cmdid, |
|
|
|
cmddesc => $cmddesc, |
|
|
|
cmddesc => $cmddesc, |
|
|
|
cmdsynopsis => $cmdsynopsis, |
|
|
|
cmdsynopsis => $cmdsynopsis, |
|
|
|
params => \@params, |
|
|
|
params => \@params, |
|
|
@ -186,6 +191,7 @@ foreach (sort keys %entries) |
|
|
|
$id =~ s/ /_/g; |
|
|
|
$id =~ s/ /_/g; |
|
|
|
print $cfile_handle " { \"$_\", |
|
|
|
print $cfile_handle " { \"$_\", |
|
|
|
N_(\"$entries{$_}{cmddesc}\"), |
|
|
|
N_(\"$entries{$_}{cmddesc}\"), |
|
|
|
|
|
|
|
\"$entries{$_}{cmdid}\", |
|
|
|
sql_help_$id, |
|
|
|
sql_help_$id, |
|
|
|
$entries{$_}{nl_count} }, |
|
|
|
$entries{$_}{nl_count} }, |
|
|
|
|
|
|
|
|
|
|
|