cli: remove `convert` command's --path and --url options
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 30 Jul 2019 01:29:51 +0000 (21:29 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 2 Aug 2019 15:46:54 +0000 (11:46 -0400)
It was decided that these two options can be removed.  They are
shortcuts for things that can be set using --params.

The --path option, in particular, is not useful as it used to be: the
de-facto standard parameter that sources are going to accept for their
input data is no longer `path` (it is now `inputs`).

Change-Id: I023e9cdaf319d7a9d2951315ce595ce099648391
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1804
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
doc/man/babeltrace2-convert.1.txt
src/cli/babeltrace2-cfg-cli-args.c
tests/cli/test_convert_args
tests/cli/test_trace_copy

index ad196de0525cb5834848daba5ba1a240e6cfb54a..62c5172afc4ac27d6dbe269fa939fd893dfc6b94 100644 (file)
@@ -197,19 +197,6 @@ opt:--params='PARAMS'::
 +
 See <<params-fmt,Parameters format>> for the format of 'PARAMS'.
 
-opt:--path='PATH'::
-    Set the nlparam:path initialization parameter of the current
-    component to 'PATH' (replace the parameter if it exists).
-+
-You can use this option instead of manually specifying `path="PATH"` in
-a opt:--params option to use your shell's tilde expansion (`~`). Tilde
-expansion requires the tilde to be the first character of the argument,
-which is not possible with `path="PATH"`.
-
-opt:--url='URL'::
-    Set the nlparam:url initialization parameter of the current
-    component to 'URL' (replace the parameter if it exists).
-
 See <<examples,EXAMPLES>> for usage examples.
 
 
@@ -491,14 +478,6 @@ opt:-p 'PARAMS', opt:--params='PARAMS'::
     component's initialization parameters, replace the parameter.
     See <<params-fmt,Parameters format>> for the format of 'PARAMS'.
 
-opt:-P 'PATH', opt:--path='PATH'::
-    Set the nlparam:path initialization parameter of the current
-    component to 'PATH' (replace the parameter if it exists).
-
-opt:-u 'URL', opt:--url='URL'::
-    Set the nlparam:url initialization parameter of the current
-    component to 'URL' (replace the parameter if it exists).
-
 
 Legacy options to create implicit components
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index 617bd51a27d4bbff27aec165bb7f1771a92f75c4..2ff5f961fd7e8509cd4da5784aeb773bda21cfbd 100644 (file)
@@ -889,7 +889,6 @@ enum {
        OPT_OUTPUT,
        OPT_OUTPUT_FORMAT,
        OPT_PARAMS,
-       OPT_PATH,
        OPT_PLUGIN_PATH,
        OPT_RESET_BASE_PARAMS,
        OPT_RETRY_DURATION,
@@ -897,7 +896,6 @@ enum {
        OPT_RUN_ARGS_0,
        OPT_STREAM_INTERSECTION,
        OPT_TIMERANGE,
-       OPT_URL,
        OPT_VERBOSE,
        OPT_VERSION,
 };
@@ -2361,8 +2359,6 @@ void print_convert_usage(FILE *fp)
        fprintf(fp, "  -p, --params=PARAMS               Add initialization parameters PARAMS to the\n");
        fprintf(fp, "                                    current component (see the expected format\n");
        fprintf(fp, "                                    of PARAMS below)\n");
-       fprintf(fp, "  -P, --path=PATH                   Set the `path` string parameter of the\n");
-       fprintf(fp, "                                    current component to PATH\n");
        fprintf(fp, "      --plugin-path=PATH[:PATH]...  Add PATH to the list of paths from which\n");
        fprintf(fp, "                                    dynamic plugins can be loaded\n");
        fprintf(fp, "      --retry-duration=DUR          When babeltrace2(1) needs to retry to run\n");
@@ -2377,8 +2373,6 @@ void print_convert_usage(FILE *fp)
        fprintf(fp, "                                    formatted for `xargs -0`, and quit\n");
        fprintf(fp, "      --stream-intersection         Only process events when all streams\n");
        fprintf(fp, "                                    are active\n");
-       fprintf(fp, "  -u, --url=URL                     Set the `url` string parameter of the\n");
-       fprintf(fp, "                                    current component to URL\n");
        fprintf(fp, "  -h, --help                        Show this help and quit\n");
        fprintf(fp, "\n");
        fprintf(fp, "Implicit `source.ctf.fs` component options:\n");
@@ -2503,14 +2497,12 @@ const struct bt_argpar_opt_descr convert_options[] = {
        { OPT_OUTPUT, 'w', "output", true },
        { OPT_OUTPUT_FORMAT, 'o', "output-format", true },
        { OPT_PARAMS, 'p', "params", true },
-       { OPT_PATH, 'P', "path", true },
        { OPT_PLUGIN_PATH, '\0', "plugin-path", true },
        { OPT_RETRY_DURATION, '\0', "retry-duration", true },
        { OPT_RUN_ARGS, '\0', "run-args", false },
        { OPT_RUN_ARGS_0, '\0', "run-args-0", false },
        { OPT_STREAM_INTERSECTION, '\0', "stream-intersection", false },
        { OPT_TIMERANGE, '\0', "timerange", true },
-       { OPT_URL, 'u', "url", true },
        { OPT_VERBOSE, 'v', "verbose", false },
        BT_ARGPAR_OPT_DESCR_SENTINEL
 };
@@ -3518,10 +3510,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
         * First pass: collect all arguments which need to be passed
         * as is to the run command. This pass can also add --name
         * arguments if needed to automatically name unnamed component
-        * instances. Also it does the following transformations:
-        *
-        *     --path=PATH -> --params=path="PATH"
-        *     --url=URL   -> --params=url="URL"
+        * instances.
         *
         * Also it appends the plugin paths of --plugin-path to
         * `plugin_paths`.
@@ -3644,29 +3633,6 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                                goto error;
                        }
                        break;
-               case OPT_PATH:
-                       if (cur_name_prefix->len == 0) {
-                               BT_CLI_LOGE_APPEND_CAUSE("No current component of which to set `path` parameter:\n    %s",
-                                       arg);
-                               goto error;
-                       }
-
-                       if (append_string_parameter_to_args(run_args, "path", arg)) {
-                               goto error;
-                       }
-                       break;
-               case OPT_URL:
-                       if (cur_name_prefix->len == 0) {
-                               BT_CLI_LOGE_APPEND_CAUSE("No current component of which to set `url` parameter:\n    %s",
-                                       arg);
-                               goto error;
-                       }
-
-
-                       if (append_string_parameter_to_args(run_args, "url", arg)) {
-                               goto error;
-                       }
-                       break;
                case OPT_NAME:
                        if (cur_name_prefix->len == 0) {
                                BT_CLI_LOGE_APPEND_CAUSE("No current component to name:\n    %s",
index 0afe79ad4f2caf32d6317a8632d951d82ab98bf8..85d8465bdda271dd1c8c35a3598f518024589d87 100755 (executable)
@@ -90,14 +90,12 @@ if [ "$BT_OS_TYPE" = "mingw" ]; then
        output_path=$(cygpath -m "$output_path")
 fi
 
-plan_tests 77
+plan_tests 73
 
 test_bt_convert_run_args 'path leftover' "$path_to_trace" "--component source.ctf.fs --name auto-disc-source-ctf-fs --params 'inputs=[\"$path_to_trace\"]' --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
 test_bt_convert_run_args 'path leftovers' "$path_to_trace $path_to_trace2" "--component source.ctf.fs --name auto-disc-source-ctf-fs --params 'inputs=[\"$path_to_trace\", \"${path_to_trace2}\"]' --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
 test_bt_convert_run_args 'path leftover + named user source with --params' "$path_to_trace --component ZZ:source.another.source --params salut=yes" "--component ZZ:source.another.source --params salut=yes --component source.ctf.fs --name auto-disc-source-ctf-fs --params 'inputs=[\"$path_to_trace\"]' --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --connect ZZ:muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
 test_bt_convert_run_args 'path leftover + named user source with --name --params' "$path_to_trace --component source.another.source --name HELLO --params salut=yes" "--component source.another.source --name HELLO --params salut=yes --component source.ctf.fs --name auto-disc-source-ctf-fs --params 'inputs=[\"$path_to_trace\"]' --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --connect HELLO:muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
-test_bt_convert_run_args 'path leftover + user source with --path --params' "$path_to_trace --component source.another.source --path some-path --params salut=yes" "--component source.another.source --params 'path=\"some-path\"' --params salut=yes --name source.another.source --component source.ctf.fs --name auto-disc-source-ctf-fs --params 'inputs=[\"$path_to_trace\"]' --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --connect 'source\\.another\\.source:muxer' --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
-test_bt_convert_run_args 'user source with --url + -o dummy' '--component MY:source.my.source --url the-url -o dummy' "--component MY:source.my.source --params 'url=\"the-url\"' --component sink.utils.dummy --name dummy --component filter.utils.muxer --name muxer --connect MY:muxer --connect muxer:dummy"
 test_bt_convert_run_args 'path leftover + --omit-home-plugin-path' "$path_to_trace --omit-home-plugin-path" "--omit-home-plugin-path --component source.ctf.fs --name auto-disc-source-ctf-fs --params 'inputs=[\"$path_to_trace\"]' --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
 test_bt_convert_run_args 'path leftover + --omit-system-plugin-path' "$path_to_trace --omit-system-plugin-path" "--omit-system-plugin-path --component source.ctf.fs --name auto-disc-source-ctf-fs --params 'inputs=[\"$path_to_trace\"]' --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
 test_bt_convert_run_args 'path leftover + --plugin-path' "--plugin-path=PATH1:PATH2 $path_to_trace" "--plugin-path PATH1:PATH2 --component source.ctf.fs --name auto-disc-source-ctf-fs --params 'inputs=[\"$path_to_trace\"]' --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
@@ -145,8 +143,6 @@ test_bt_convert_fails 'bad --component format (extra dot found)' '--component na
 test_bt_convert_fails 'duplicate component name' '--component hello:sink.a.b --component hello:source.c.d'
 test_bt_convert_fails 'unknown option' '--component hello:sink.a.b --salut'
 test_bt_convert_fails '--params without current component' '--params lol=23'
-test_bt_convert_fails '--path without current component' "--path $path_to_trace"
-test_bt_convert_fails '--url without current component' '--url net://some-host/host/target/session'
 test_bt_convert_fails '--nane without current component' '--name chapeau'
 test_bt_convert_fails 'duplicate --begin' '--begin abc --clock-seconds --begin cde'
 test_bt_convert_fails 'duplicate --end' '--begin abc --end xyz --clock-seconds --end cde'
index 8b4a46d40e2c43a2353b3eb476413346fee808d4..90dce380642b30dd8a0813d846857bb7aa4ab800 100755 (executable)
@@ -73,7 +73,7 @@ for path in "${SUCCESS_TRACES[@]}"; do
                fi
        fi
 
-       "${BT_TESTS_BT2_BIN}" "${path}" --component sink.ctf.fs --path "${out_path}" >/dev/null 2>&1
+       "${BT_TESTS_BT2_BIN}" "${path}" --component sink.ctf.fs "--params=path=\"${out_path}\"" >/dev/null 2>&1
        ok $? "Copy trace ${trace} with ctf-fs sink"
 
        "${BT_TESTS_BT2_BIN}" "${out_path}" >/dev/null 2>&1
This page took 0.038587 seconds and 4 git commands to generate.