]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
main: tidy up getopt
authorVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 9 Jan 2020 13:51:44 +0000 (14:51 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 17 Jan 2020 14:01:44 +0000 (15:01 +0100)
- consistent order of the options on the three places in parse_args()
- drop remains of -m -k -K
  It didn't seem to cause any problems except confusion in
  $ kresd -k
  kresd: option requires an argument -- 'k'

daemon/main.c

index d47e8a53555ee1c27f21936c27907e60a21cdff7..126e54ac0bf7eab445aec5002342fd37f7a3fa09 100644 (file)
@@ -354,7 +354,6 @@ static int parse_args(int argc, char **argv, struct args *args)
        struct option opts[] = {
                {"addr",       required_argument, 0, 'a'},
                {"tls",        required_argument, 0, 't'},
-               {"fd",         required_argument, 0, 'S'},
                {"config",     required_argument, 0, 'c'},
                {"forks",      required_argument, 0, 'f'},
                {"noninteractive",   no_argument, 0, 'n'},
@@ -362,9 +361,10 @@ static int parse_args(int argc, char **argv, struct args *args)
                {"quiet",            no_argument, 0, 'q'},
                {"version",          no_argument, 0, 'V'},
                {"help",             no_argument, 0, 'h'},
+               {"fd",         required_argument, 0, 'S'},
                {0, 0, 0, 0}
        };
-       while ((c = getopt_long(argc, argv, "a:t:S:c:f:nm:K:k:vqVh", opts, &li)) != -1) {
+       while ((c = getopt_long(argc, argv, "a:t:c:f:nvqVhS:", opts, &li)) != -1) {
                switch (c)
                {
                case 'a':