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.
This commit is contained in:
Jacobo Aragunde Pérez 2018-09-17 19:19:13 +02:00
parent f44d0f387b
commit 917ef9eec2

View File

@ -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);