aboutsummaryrefslogtreecommitdiff
path: root/src/backend/bootstrap/bootstrap.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-12-12 14:33:41 +0100
committerPeter Eisentraut <peter@eisentraut.org>2022-12-12 15:20:00 +0100
commitdf8b8968d4095f44acd6de03b4add65f9709b79d (patch)
tree249063ed382f2d9fc913729de73bac3d915afcab /src/backend/bootstrap/bootstrap.c
parent840ff5f451cd9a391d237fc60894fea7ad82a189 (diff)
downloadpostgresql-df8b8968d4095f44acd6de03b4add65f9709b79d.tar.gz
postgresql-df8b8968d4095f44acd6de03b4add65f9709b79d.zip
Order getopt arguments
Order the letters in the arguments of getopt() and getopt_long(), as well as in the subsequent switch statements. In most cases, I used alphabetical with lower case first. In a few cases, existing different orders (e.g., upper case first) was kept to reduce the diff size. Discussion: https://www.postgresql.org/message-id/flat/3efd0fe8-351b-f836-9122-886002602357%40enterprisedb.com
Diffstat (limited to 'src/backend/bootstrap/bootstrap.c')
-rw-r--r--src/backend/bootstrap/bootstrap.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c
index 661ebacb0c2..d623ad9d50d 100644
--- a/src/backend/bootstrap/bootstrap.c
+++ b/src/backend/bootstrap/bootstrap.c
@@ -228,6 +228,32 @@ BootstrapModeMain(int argc, char *argv[], bool check_only)
case 'B':
SetConfigOption("shared_buffers", optarg, PGC_POSTMASTER, PGC_S_ARGV);
break;
+ case 'c':
+ case '-':
+ {
+ char *name,
+ *value;
+
+ ParseLongOption(optarg, &name, &value);
+ if (!value)
+ {
+ if (flag == '-')
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("--%s requires a value",
+ optarg)));
+ else
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("-c %s requires a value",
+ optarg)));
+ }
+
+ SetConfigOption(name, value, PGC_POSTMASTER, PGC_S_ARGV);
+ pfree(name);
+ pfree(value);
+ break;
+ }
case 'D':
userDoption = pstrdup(optarg);
break;
@@ -265,32 +291,6 @@ BootstrapModeMain(int argc, char *argv[], bool check_only)
PGC_S_DYNAMIC_DEFAULT);
}
break;
- case 'c':
- case '-':
- {
- char *name,
- *value;
-
- ParseLongOption(optarg, &name, &value);
- if (!value)
- {
- if (flag == '-')
- ereport(ERROR,
- (errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("--%s requires a value",
- optarg)));
- else
- ereport(ERROR,
- (errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("-c %s requires a value",
- optarg)));
- }
-
- SetConfigOption(name, value, PGC_POSTMASTER, PGC_S_ARGV);
- pfree(name);
- pfree(value);
- break;
- }
default:
write_stderr("Try \"%s --help\" for more information.\n",
progname);