31/07/2025 18:00, Bruce Richardson:
> The echoing of commands contained in a file loaded via the "load"
> command on testpmd CLI is governed by whether or not a cmdline-file or
> cmdline-file-noecho had been passed to testpmd on the commandline.
> 
> Remove the use of a global setting for this, and explicitly add a
> "load_echo" command to match the "load" command.
> 
> Signed-off-by: Bruce Richardson <[email protected]>
> ---
[...]
> @@ -11646,7 +11646,9 @@ cmd_load_from_file_parsed(
>  {
>       struct cmd_cmdfile_result *res = parsed_result;
>  
> -     cmdline_read_from_file(res->filename);
> +     if (cmdline_read_from_file(res->filename, false) != 0) {
> +             fprintf(stderr, "Failed to load commands from file: %s\n", 
> res->filename);
> +     }
>  }
> +static void
> +cmd_load_echo_file_parsed(
> +     void *parsed_result,
> +     __rte_unused struct cmdline *cl,
> +     __rte_unused void *data)
> +{
> +     struct cmd_load_echo_result *res = parsed_result;
> +
> +     if (cmdline_read_from_file(res->filename, true) != 0)
> +             fprintf(stderr, "Failed to load commands from file: %s\n", 
> res->filename);
> +}

These 2 functions cmd_load_from_file_parsed()
and cmd_load_echo_file_parsed() could be merged
in a single function by passing the echo boolean as callback data.


Reply via email to