Skip to content

Commit

Permalink
llext: Make the shell list command output nicer
Browse files Browse the repository at this point in the history
Remove unnecessary newline characters from shell_print, it already adds them.
Align the table pipe characters better in the list of modules.

Signed-off-by: Tom Burdick <[email protected]>
  • Loading branch information
teburd committed Nov 1, 2023
1 parent d360955 commit 244966c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions subsys/llext/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ static int cmd_llext_list_symbols(const struct shell *sh, size_t argc, char *arg
}

shell_print(sh, "Extension: %s symbols", m->name);
shell_print(sh, "| Symbol | Address |\n");
shell_print(sh, "| Symbol | Address |");
for (elf_word i = 0; i < m->sym_tab.sym_cnt; i++) {
shell_print(sh, "| %16s | %p |\n", m->sym_tab.syms[i].name,
shell_print(sh, "| %16s | %p |", m->sym_tab.syms[i].name,
m->sym_tab.syms[i].addr);
}

Expand Down Expand Up @@ -84,10 +84,10 @@ static int cmd_llext_list(const struct shell *sh, size_t argc, char *argv[])
sys_snode_t *node;
struct llext *ext;

shell_print(sh, "| Name | Size |\n");
shell_print(sh, "| Name | Size |");
SYS_SLIST_FOR_EACH_NODE(llext_list(), node) {
ext = CONTAINER_OF(node, struct llext, _llext_list);
shell_print(sh, "| %16s | %12d |\n", ext->name, ext->mem_size);
shell_print(sh, "| %16s | %12d |", ext->name, ext->mem_size);
}

return 0;
Expand Down

0 comments on commit 244966c

Please sign in to comment.