diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2022-12-12 14:33:41 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2022-12-12 15:20:00 +0100 |
commit | df8b8968d4095f44acd6de03b4add65f9709b79d (patch) | |
tree | 249063ed382f2d9fc913729de73bac3d915afcab /src/bin/scripts/reindexdb.c | |
parent | 840ff5f451cd9a391d237fc60894fea7ad82a189 (diff) | |
download | postgresql-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/bin/scripts/reindexdb.c')
-rw-r--r-- | src/bin/scripts/reindexdb.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/bin/scripts/reindexdb.c b/src/bin/scripts/reindexdb.c index 0e93a4eeff0..1fbf924ab3a 100644 --- a/src/bin/scripts/reindexdb.c +++ b/src/bin/scripts/reindexdb.c @@ -109,57 +109,57 @@ main(int argc, char *argv[]) handle_help_version_opts(argc, argv, "reindexdb", help); /* process command-line options */ - while ((c = getopt_long(argc, argv, "h:p:U:wWeqS:d:ast:i:j:v", long_options, &optindex)) != -1) + while ((c = getopt_long(argc, argv, "ad:eh:i:j:qp:sS:t:U:vwW", long_options, &optindex)) != -1) { switch (c) { - case 'h': - host = pg_strdup(optarg); + case 'a': + alldb = true; break; - case 'p': - port = pg_strdup(optarg); + case 'd': + dbname = pg_strdup(optarg); break; - case 'U': - username = pg_strdup(optarg); + case 'e': + echo = true; break; - case 'w': - prompt_password = TRI_NO; + case 'h': + host = pg_strdup(optarg); break; - case 'W': - prompt_password = TRI_YES; + case 'i': + simple_string_list_append(&indexes, optarg); break; - case 'e': - echo = true; + case 'j': + if (!option_parse_int(optarg, "-j/--jobs", 1, INT_MAX, + &concurrentCons)) + exit(1); break; case 'q': quiet = true; break; - case 'S': - simple_string_list_append(&schemas, optarg); - break; - case 'd': - dbname = pg_strdup(optarg); - break; - case 'a': - alldb = true; + case 'p': + port = pg_strdup(optarg); break; case 's': syscatalog = true; break; + case 'S': + simple_string_list_append(&schemas, optarg); + break; case 't': simple_string_list_append(&tables, optarg); break; - case 'i': - simple_string_list_append(&indexes, optarg); - break; - case 'j': - if (!option_parse_int(optarg, "-j/--jobs", 1, INT_MAX, - &concurrentCons)) - exit(1); + case 'U': + username = pg_strdup(optarg); break; case 'v': verbose = true; break; + case 'w': + prompt_password = TRI_NO; + break; + case 'W': + prompt_password = TRI_YES; + break; case 1: concurrently = true; break; |