From 917ef9eec23b63015b5e20e9c7b9350c08c55512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacobo=20Aragunde=20P=C3=A9rez?= Date: Mon, 17 Sep 2018 19:19:13 +0200 Subject: [PATCH] Add -p PORT command-line parameter. FIXME: at this point, the port parameter set in the configuration file will take precedence over the command-line argument. It should be the opposite. --- src/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 43170c5..6fd5f72 100644 --- a/src/main.c +++ b/src/main.c @@ -173,7 +173,7 @@ process_cmdline (int argc, char **argv, struct config_s *conf) { int opt; - while ((opt = getopt (argc, argv, "c:vdh")) != EOF) { + while ((opt = getopt (argc, argv, "c:p:vdh")) != EOF) { switch (opt) { case 'v': display_version (); @@ -196,6 +196,10 @@ process_cmdline (int argc, char **argv, struct config_s *conf) } break; + case 'p': + conf->port = strtol(optarg, NULL, 10); + break; + case 'h': display_usage (); exit (EX_OK);