Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbd9c8e7

Browse files
committed
Move long_options structures to the top of main() functions, for
consistency.Per suggestion from Tom.
1 parentda63fec commitbd9c8e7

File tree

6 files changed

+37
-34
lines changed

6 files changed

+37
-34
lines changed

‎contrib/pg_test_fsync/pg_test_fsync.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ handle_args(int argc, char *argv[])
140140
{"secs-per-test",required_argument,NULL,'s'},
141141
{NULL,0,NULL,0}
142142
};
143+
143144
intoption;/* Command line option */
144145
intoptindex=0;/* used by getopt_long */
145146

‎contrib/pg_test_timing/pg_test_timing.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ handle_args(int argc, char *argv[])
4343
{"duration",required_argument,NULL,'d'},
4444
{NULL,0,NULL,0}
4545
};
46+
4647
intoption;/* Command line option */
4748
intoptindex=0;/* used by getopt_long */
4849

‎contrib/pgbench/pgbench.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,6 +1915,15 @@ printResults(int ttype, int normal_xacts, int nclients,
19151915
int
19161916
main(intargc,char**argv)
19171917
{
1918+
staticstructoptionlong_options[]= {
1919+
{"foreign-keys",no_argument,&foreign_keys,1},
1920+
{"index-tablespace",required_argument,NULL,3},
1921+
{"tablespace",required_argument,NULL,2},
1922+
{"unlogged-tables",no_argument,&unlogged_tables,1},
1923+
{"sampling-rate",required_argument,NULL,4},
1924+
{NULL,0,NULL,0}
1925+
};
1926+
19181927
intc;
19191928
intnclients=1;/* default number of simulated clients */
19201929
intnthreads=1;/* default number of threads */
@@ -1937,15 +1946,6 @@ main(int argc, char **argv)
19371946

19381947
inti;
19391948

1940-
staticstructoptionlong_options[]= {
1941-
{"foreign-keys",no_argument,&foreign_keys,1},
1942-
{"index-tablespace",required_argument,NULL,3},
1943-
{"tablespace",required_argument,NULL,2},
1944-
{"unlogged-tables",no_argument,&unlogged_tables,1},
1945-
{"sampling-rate",required_argument,NULL,4},
1946-
{NULL,0,NULL,0}
1947-
};
1948-
19491949
#ifdefHAVE_GETRLIMIT
19501950
structrlimitrlim;
19511951
#endif

‎src/bin/pg_basebackup/pg_receivexlog.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ main(int argc, char **argv)
315315
{"verbose",no_argument,NULL,'v'},
316316
{NULL,0,NULL,0}
317317
};
318+
318319
intc;
319320
intoption_index;
320321

‎src/bin/pg_dump/pg_dumpall.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,6 @@ static char *filename = NULL;
8282
int
8383
main(intargc,char*argv[])
8484
{
85-
char*pghost=NULL;
86-
char*pgport=NULL;
87-
char*pguser=NULL;
88-
char*pgdb=NULL;
89-
char*use_role=NULL;
90-
enumtrivalueprompt_password=TRI_DEFAULT;
91-
booldata_only= false;
92-
boolglobals_only= false;
93-
booloutput_clean= false;
94-
boolroles_only= false;
95-
booltablespaces_only= false;
96-
PGconn*conn;
97-
intencoding;
98-
constchar*std_strings;
99-
intc,
100-
ret;
101-
intoptindex;
102-
10385
staticstructoptionlong_options[]= {
10486
{"data-only",no_argument,NULL,'a'},
10587
{"clean",no_argument,NULL,'c'},
@@ -142,6 +124,24 @@ main(int argc, char *argv[])
142124
{NULL,0,NULL,0}
143125
};
144126

127+
char*pghost=NULL;
128+
char*pgport=NULL;
129+
char*pguser=NULL;
130+
char*pgdb=NULL;
131+
char*use_role=NULL;
132+
enumtrivalueprompt_password=TRI_DEFAULT;
133+
booldata_only= false;
134+
boolglobals_only= false;
135+
booloutput_clean= false;
136+
boolroles_only= false;
137+
booltablespaces_only= false;
138+
PGconn*conn;
139+
intencoding;
140+
constchar*std_strings;
141+
intc,
142+
ret;
143+
intoptindex;
144+
145145
set_pglocale_pgservice(argv[0],PG_TEXTDOMAIN("pg_dump"));
146146

147147
progname=get_progname(argv[0]);

‎src/test/regress/pg_regress.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,13 +1906,6 @@ help(void)
19061906
int
19071907
regression_main(intargc,char*argv[],init_functionifunc,test_functiontfunc)
19081908
{
1909-
_stringlist*sl;
1910-
intc;
1911-
inti;
1912-
intoption_index;
1913-
charbuf[MAXPGPATH*4];
1914-
charbuf2[MAXPGPATH*4];
1915-
19161909
staticstructoptionlong_options[]= {
19171910
{"help",no_argument,NULL,'h'},
19181911
{"version",no_argument,NULL,'V'},
@@ -1941,6 +1934,13 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
19411934
{NULL,0,NULL,0}
19421935
};
19431936

1937+
_stringlist*sl;
1938+
intc;
1939+
inti;
1940+
intoption_index;
1941+
charbuf[MAXPGPATH*4];
1942+
charbuf2[MAXPGPATH*4];
1943+
19441944
progname=get_progname(argv[0]);
19451945
set_pglocale_pgservice(argv[0],PG_TEXTDOMAIN("pg_regress"));
19461946

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp