return ret;
}
+int validate_url_option_combination(void)
+{
+ int ret = 0;
+ int used_count = 0;
+
+ used_count += !!opt_url;
+ used_count += !!opt_output_path;
+ used_count += (opt_data_url || opt_ctrl_url);
+ if (used_count > 1) {
+ ERR("Only one of the --set-url, --ctrl-url/data-url, or --output options may be used at once.");
+ ret = -1;
+ }
+
+ return ret;
+}
+
/*
* The 'create <options>' first level command
*
{
int opt, ret = CMD_SUCCESS, command_ret = CMD_SUCCESS, success = 1;
char *opt_arg = NULL;
+ const char *leftover = NULL;
static poptContext pc;
pc = poptGetContext(NULL, argc, argv, long_options, 0);
goto end;
}
+ ret = validate_url_option_combination();
+ if (ret) {
+ ret = CMD_ERROR;
+ goto end;
+ }
+
/* Spawn a session daemon if needed */
if (!opt_no_sessiond) {
ret = launch_sessiond();
}
opt_session_name = (char*) poptGetArg(pc);
+ leftover = poptGetArg(pc);
+ if (leftover) {
+ ERR("Unknown argument: %s", leftover);
+ ret = CMD_ERROR;
+ goto end;
+ }
+
command_ret = create_session();
if (command_ret) {
success = 0;