This is an automated email from Gerrit.

"Antonio Borneo <[email protected]>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9184

-- gerrit

commit 6144c9fff5dcc34472d1509d5cc304fdf1b19866
Author: Antonio Borneo <[email protected]>
Date:   Thu Oct 23 23:27:45 2025 +0200

    command: let 'help' and 'usage' to use command_print()
    
    The commands 'help' and 'usage' still rely on LOG_USER_N() and
    LOG_USER() for the output.
    
    Convert them to command_print().
    
    Change-Id: I6e77dd761b61344ff797f661456896388bba89aa
    Signed-off-by: Antonio Borneo <[email protected]>

diff --git a/src/helper/command.c b/src/helper/command.c
index 4cce57f756..cc660b8b65 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -674,12 +674,13 @@ static COMMAND_HELPER(command_help_show_list, bool 
show_help, const char *cmd_ma
 
 #define HELP_LINE_WIDTH(_n) (int)(76 - (2 * _n))
 
-static void command_help_show_indent(unsigned int n)
+static void command_help_show_indent(struct command_invocation *cmd, unsigned 
int n)
 {
        for (unsigned int i = 0; i < n; i++)
-               LOG_USER_N("  ");
+               command_print_sameline(cmd, "  ");
 }
-static void command_help_show_wrap(const char *str, unsigned int n, unsigned 
int n2)
+static void command_help_show_wrap(struct command_invocation *cmd,
+       const char *str, unsigned int n, unsigned int n2)
 {
        const char *cp = str, *last = str;
        while (*cp) {
@@ -692,8 +693,8 @@ static void command_help_show_wrap(const char *str, 
unsigned int n, unsigned int
                } while ((next - last < HELP_LINE_WIDTH(n)) && *next != '\0');
                if (next - last < HELP_LINE_WIDTH(n))
                        cp = next;
-               command_help_show_indent(n);
-               LOG_USER("%.*s", (int)(cp - last), last);
+               command_help_show_indent(cmd, n);
+               command_print(cmd, "%.*s", (int)(cp - last), last);
                last = cp + 1;
                n = n2;
        }
@@ -715,10 +716,10 @@ static COMMAND_HELPER(command_help_show, struct 
help_entry *c,
        if (is_match) {
                if (c->usage && strlen(c->usage) > 0) {
                        char *msg = alloc_printf("%s %s", c->cmd_name, 
c->usage);
-                       command_help_show_wrap(msg, n, n + 5);
+                       command_help_show_wrap(CMD, msg, n, n + 5);
                        free(msg);
                } else {
-                       command_help_show_wrap(c->cmd_name, n, n + 5);
+                       command_help_show_wrap(CMD, c->cmd_name, n, n + 5);
                }
        }
 
@@ -752,7 +753,7 @@ static COMMAND_HELPER(command_help_show, struct help_entry 
*c,
                        return ERROR_FAIL;
                }
 
-               command_help_show_wrap(msg, n + 3, n + 3);
+               command_help_show_wrap(CMD, msg, n + 3, n + 3);
                free(msg);
        }
 

-- 

Reply via email to