X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fcreate.c;h=1ec77ae6f64800841b6fa2e17bd84f5ba1f2eedf;hb=d685c8c6e082402837b23be4ad81d9cae59a8a3b;hp=faf9f3e0d780274d2beb69ab838d2302e4713dcd;hpb=38df09b786426464b27a0f6fc2d852935d56eaad;p=lttng-tools.git diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c index faf9f3e0d..1ec77ae6f 100644 --- a/src/bin/lttng/commands/create.c +++ b/src/bin/lttng/commands/create.c @@ -616,6 +616,22 @@ end: 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 ' first level command * @@ -685,6 +701,12 @@ int cmd_create(int argc, const char **argv) 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();