aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2012-11-30 14:49:55 -0500
committerBruce Momjian <bruce@momjian.us>2012-11-30 14:49:55 -0500
commitbd9c8e741b5724e31b2a3d8da9f0218f7b3b44e5 (patch)
tree5a322322aab3af9c3847155431e7bb0d9400e911 /src
parentda63fec7dbb0c459aa0f8753a3d30a3a6cd3d73f (diff)
downloadpostgresql-bd9c8e741b5724e31b2a3d8da9f0218f7b3b44e5.tar.gz
postgresql-bd9c8e741b5724e31b2a3d8da9f0218f7b3b44e5.zip
Move long_options structures to the top of main() functions, for
consistency. Per suggestion from Tom.
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_basebackup/pg_receivexlog.c1
-rw-r--r--src/bin/pg_dump/pg_dumpall.c36
-rw-r--r--src/test/regress/pg_regress.c14
3 files changed, 26 insertions, 25 deletions
diff --git a/src/bin/pg_basebackup/pg_receivexlog.c b/src/bin/pg_basebackup/pg_receivexlog.c
index 843fc69294d..54524834f75 100644
--- a/src/bin/pg_basebackup/pg_receivexlog.c
+++ b/src/bin/pg_basebackup/pg_receivexlog.c
@@ -315,6 +315,7 @@ main(int argc, char **argv)
{"verbose", no_argument, NULL, 'v'},
{NULL, 0, NULL, 0}
};
+
int c;
int option_index;
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index ca95bad1cc0..77dfbc282f7 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -82,24 +82,6 @@ static char *filename = NULL;
int
main(int argc, char *argv[])
{
- char *pghost = NULL;
- char *pgport = NULL;
- char *pguser = NULL;
- char *pgdb = NULL;
- char *use_role = NULL;
- enum trivalue prompt_password = TRI_DEFAULT;
- bool data_only = false;
- bool globals_only = false;
- bool output_clean = false;
- bool roles_only = false;
- bool tablespaces_only = false;
- PGconn *conn;
- int encoding;
- const char *std_strings;
- int c,
- ret;
- int optindex;
-
static struct option long_options[] = {
{"data-only", no_argument, NULL, 'a'},
{"clean", no_argument, NULL, 'c'},
@@ -142,6 +124,24 @@ main(int argc, char *argv[])
{NULL, 0, NULL, 0}
};
+ char *pghost = NULL;
+ char *pgport = NULL;
+ char *pguser = NULL;
+ char *pgdb = NULL;
+ char *use_role = NULL;
+ enum trivalue prompt_password = TRI_DEFAULT;
+ bool data_only = false;
+ bool globals_only = false;
+ bool output_clean = false;
+ bool roles_only = false;
+ bool tablespaces_only = false;
+ PGconn *conn;
+ int encoding;
+ const char *std_strings;
+ int c,
+ ret;
+ int optindex;
+
set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_dump"));
progname = get_progname(argv[0]);
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 81e7b69231b..5a656f2e52d 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -1906,13 +1906,6 @@ help(void)
int
regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc)
{
- _stringlist *sl;
- int c;
- int i;
- int option_index;
- char buf[MAXPGPATH * 4];
- char buf2[MAXPGPATH * 4];
-
static struct option long_options[] = {
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'V'},
@@ -1941,6 +1934,13 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
{NULL, 0, NULL, 0}
};
+ _stringlist *sl;
+ int c;
+ int i;
+ int option_index;
+ char buf[MAXPGPATH * 4];
+ char buf2[MAXPGPATH * 4];
+
progname = get_progname(argv[0]);
set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_regress"));