Commit ea966669 authored by Jeremy White's avatar Jeremy White

Allow a command line override of the allow-control config choice.

parent 638b9968
...@@ -144,6 +144,7 @@ static void usage(options_t *options, char *argv0) ...@@ -144,6 +144,7 @@ static void usage(options_t *options, char *argv0)
printf("\n"); printf("\n");
printf("Options:\n"); printf("Options:\n");
printf("%s [--allow-control]\n", indent); printf("%s [--allow-control]\n", indent);
printf("%s [--no-allow-control]\n", indent);
printf("%s [--timeout=<seconds>]\n", indent); printf("%s [--timeout=<seconds>]\n", indent);
printf("%s [--display=<DISPLAY>]\n", indent); printf("%s [--display=<DISPLAY>]\n", indent);
printf("%s [--generate-password[=<len>]\n", indent); printf("%s [--generate-password[=<len>]\n", indent);
...@@ -227,7 +228,8 @@ int options_parse_arguments(int argc, char *argv[], options_t *options) ...@@ -227,7 +228,8 @@ int options_parse_arguments(int argc, char *argv[], options_t *options)
int rc; int rc;
int longindex = 0; int longindex = 0;
enum option_types { OPTION_ALLOW_CONTROL, OPTION_TIMEOUT, OPTION_AUTO, OPTION_HIDE, enum option_types { OPTION_ALLOW_CONTROL, OPTION_DISALLOW_CONTROL,
OPTION_TIMEOUT, OPTION_AUTO, OPTION_HIDE,
OPTION_PASSWORD, OPTION_PASSWORD_FILE, OPTION_CONFIG, OPTION_SSL, OPTION_PASSWORD, OPTION_PASSWORD_FILE, OPTION_CONFIG, OPTION_SSL,
OPTION_GENERATE_PASSWORD, OPTION_DISPLAY, OPTION_MINIMIZE, OPTION_GENERATE_PASSWORD, OPTION_DISPLAY, OPTION_MINIMIZE,
OPTION_HELP OPTION_HELP
...@@ -236,6 +238,7 @@ int options_parse_arguments(int argc, char *argv[], options_t *options) ...@@ -236,6 +238,7 @@ int options_parse_arguments(int argc, char *argv[], options_t *options)
static struct option long_options[] = static struct option long_options[] =
{ {
{"allow-control", 0, 0, OPTION_ALLOW_CONTROL }, {"allow-control", 0, 0, OPTION_ALLOW_CONTROL },
{"no-allow-control", 0, 0, OPTION_DISALLOW_CONTROL },
{"timeout", 1, 0, OPTION_TIMEOUT }, {"timeout", 1, 0, OPTION_TIMEOUT },
{"auto", 1, 0, OPTION_AUTO }, {"auto", 1, 0, OPTION_AUTO },
{"hide", 0, 0, OPTION_HIDE }, {"hide", 0, 0, OPTION_HIDE },
...@@ -262,6 +265,10 @@ int options_parse_arguments(int argc, char *argv[], options_t *options) ...@@ -262,6 +265,10 @@ int options_parse_arguments(int argc, char *argv[], options_t *options)
options->allow_control = 1; options->allow_control = 1;
break; break;
case OPTION_DISALLOW_CONTROL:
options->allow_control = 0;
break;
case OPTION_TIMEOUT: case OPTION_TIMEOUT:
options->timeout = atol(optarg); options->timeout = atol(optarg);
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment