shell: remove obsolete \r characters
shell parses output string and it adds \r for each found \n. It is no longer needed to keep \r for each shell message. Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
This commit is contained in:
parent
0c678fac9d
commit
4d491b283b
7 changed files with 25 additions and 25 deletions
|
@ -35,7 +35,7 @@ static bool device_get_config_level(const struct shell *shell, int level)
|
||||||
info++) {
|
info++) {
|
||||||
if (info->driver_api != NULL) {
|
if (info->driver_api != NULL) {
|
||||||
devices = true;
|
devices = true;
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "- %s\r\n",
|
shell_fprintf(shell, SHELL_NORMAL, "- %s\n",
|
||||||
info->config->name);
|
info->config->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,28 +49,28 @@ static int cmd_device_levels(const struct shell *shell,
|
||||||
ARG_UNUSED(argv);
|
ARG_UNUSED(argv);
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "POST_KERNEL:\r\n");
|
shell_fprintf(shell, SHELL_NORMAL, "POST_KERNEL:\n");
|
||||||
ret = device_get_config_level(shell, _SYS_INIT_LEVEL_POST_KERNEL);
|
ret = device_get_config_level(shell, _SYS_INIT_LEVEL_POST_KERNEL);
|
||||||
if (ret == false) {
|
if (ret == false) {
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "- None\r\n");
|
shell_fprintf(shell, SHELL_NORMAL, "- None\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "APPLICATION:\r\n");
|
shell_fprintf(shell, SHELL_NORMAL, "APPLICATION:\n");
|
||||||
ret = device_get_config_level(shell, _SYS_INIT_LEVEL_APPLICATION);
|
ret = device_get_config_level(shell, _SYS_INIT_LEVEL_APPLICATION);
|
||||||
if (ret == false) {
|
if (ret == false) {
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "- None\r\n");
|
shell_fprintf(shell, SHELL_NORMAL, "- None\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "PRE KERNEL 1:\r\n");
|
shell_fprintf(shell, SHELL_NORMAL, "PRE KERNEL 1:\n");
|
||||||
ret = device_get_config_level(shell, _SYS_INIT_LEVEL_PRE_KERNEL_1);
|
ret = device_get_config_level(shell, _SYS_INIT_LEVEL_PRE_KERNEL_1);
|
||||||
if (ret == false) {
|
if (ret == false) {
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "- None\r\n");
|
shell_fprintf(shell, SHELL_NORMAL, "- None\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "PRE KERNEL 2:\r\n");
|
shell_fprintf(shell, SHELL_NORMAL, "PRE KERNEL 2:\n");
|
||||||
ret = device_get_config_level(shell, _SYS_INIT_LEVEL_PRE_KERNEL_2);
|
ret = device_get_config_level(shell, _SYS_INIT_LEVEL_PRE_KERNEL_2);
|
||||||
if (ret == false) {
|
if (ret == false) {
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "- None\r\n");
|
shell_fprintf(shell, SHELL_NORMAL, "- None\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -83,10 +83,10 @@ static int cmd_device_list(const struct shell *shell,
|
||||||
ARG_UNUSED(argc);
|
ARG_UNUSED(argc);
|
||||||
ARG_UNUSED(argv);
|
ARG_UNUSED(argv);
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "devices:\r\n");
|
shell_fprintf(shell, SHELL_NORMAL, "devices:\n");
|
||||||
for (info = __device_init_start; info != __device_init_end; info++) {
|
for (info = __device_init_start; info != __device_init_end; info++) {
|
||||||
if (info->driver_api != NULL) {
|
if (info->driver_api != NULL) {
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "- %s\r\n",
|
shell_fprintf(shell, SHELL_NORMAL, "- %s\n",
|
||||||
info->config->name);
|
info->config->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ static int cmd_kernel_version(const struct shell *shell,
|
||||||
ARG_UNUSED(argc);
|
ARG_UNUSED(argc);
|
||||||
ARG_UNUSED(argv);
|
ARG_UNUSED(argv);
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "Zephyr version %d.%d.%d\r\n",
|
shell_fprintf(shell, SHELL_NORMAL, "Zephyr version %d.%d.%d\n",
|
||||||
SYS_KERNEL_VER_MAJOR(version),
|
SYS_KERNEL_VER_MAJOR(version),
|
||||||
SYS_KERNEL_VER_MINOR(version),
|
SYS_KERNEL_VER_MINOR(version),
|
||||||
SYS_KERNEL_VER_PATCHLEVEL(version));
|
SYS_KERNEL_VER_PATCHLEVEL(version));
|
||||||
|
@ -35,7 +35,7 @@ static int cmd_kernel_uptime(const struct shell *shell,
|
||||||
ARG_UNUSED(argc);
|
ARG_UNUSED(argc);
|
||||||
ARG_UNUSED(argv);
|
ARG_UNUSED(argv);
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "Uptime: %u ms\r\n",
|
shell_fprintf(shell, SHELL_NORMAL, "Uptime: %u ms\n",
|
||||||
k_uptime_get_32());
|
k_uptime_get_32());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ static int cmd_kernel_cycles(const struct shell *shell,
|
||||||
ARG_UNUSED(argc);
|
ARG_UNUSED(argc);
|
||||||
ARG_UNUSED(argv);
|
ARG_UNUSED(argv);
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "cycles: %u hw cycles\r\n",
|
shell_fprintf(shell, SHELL_NORMAL, "cycles: %u hw cycles\n",
|
||||||
k_cycle_get_32());
|
k_cycle_get_32());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -68,16 +68,16 @@ static void shell_tdata_dump(const struct k_thread *thread, void *user_data)
|
||||||
tname = k_thread_name_get((struct k_thread *)thread);
|
tname = k_thread_name_get((struct k_thread *)thread);
|
||||||
|
|
||||||
shell_fprintf((const struct shell *)user_data, SHELL_NORMAL,
|
shell_fprintf((const struct shell *)user_data, SHELL_NORMAL,
|
||||||
"%s%p %-10s\r\n",
|
"%s%p %-10s\n",
|
||||||
(thread == k_current_get()) ? "*" : " ",
|
(thread == k_current_get()) ? "*" : " ",
|
||||||
thread,
|
thread,
|
||||||
tname ? tname : "NA");
|
tname ? tname : "NA");
|
||||||
shell_fprintf((const struct shell *)user_data, SHELL_NORMAL,
|
shell_fprintf((const struct shell *)user_data, SHELL_NORMAL,
|
||||||
"\toptions: 0x%x, priority: %d\r\n",
|
"\toptions: 0x%x, priority: %d\n",
|
||||||
thread->base.user_options,
|
thread->base.user_options,
|
||||||
thread->base.prio);
|
thread->base.prio);
|
||||||
shell_fprintf((const struct shell *)user_data, SHELL_NORMAL,
|
shell_fprintf((const struct shell *)user_data, SHELL_NORMAL,
|
||||||
"\tstack size %u, unused %u, usage %u / %u (%u %%)\r\n\n",
|
"\tstack size %u, unused %u, usage %u / %u (%u %%)\n\n",
|
||||||
size, unused, size - unused, size, pcnt);
|
size, unused, size - unused, size, pcnt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ static int cmd_kernel_threads(const struct shell *shell,
|
||||||
ARG_UNUSED(argc);
|
ARG_UNUSED(argc);
|
||||||
ARG_UNUSED(argv);
|
ARG_UNUSED(argv);
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "Threads:\r\n");
|
shell_fprintf(shell, SHELL_NORMAL, "Threads:\n");
|
||||||
k_thread_foreach(shell_tdata_dump, (void *)shell);
|
k_thread_foreach(shell_tdata_dump, (void *)shell);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ static void shell_stack_dump(const struct k_thread *thread, void *user_data)
|
||||||
pcnt = ((size - unused) * 100) / size;
|
pcnt = ((size - unused) * 100) / size;
|
||||||
|
|
||||||
shell_fprintf((const struct shell *)user_data, SHELL_NORMAL,
|
shell_fprintf((const struct shell *)user_data, SHELL_NORMAL,
|
||||||
"0x%08X %-10s (real size %u):\tunused %u\tusage %u / %u (%u %%)\r\n",
|
"0x%08X %-10s (real size %u):\tunused %u\tusage %u / %u (%u %%)\n",
|
||||||
(u32_t)thread,
|
(u32_t)thread,
|
||||||
tname ? tname : "NA",
|
tname ? tname : "NA",
|
||||||
size, unused, size - unused, size, pcnt);
|
size, unused, size - unused, size, pcnt);
|
||||||
|
|
|
@ -193,7 +193,7 @@ static void tab_item_print(const struct shell *shell, const char *option,
|
||||||
diff = longest_option - shell_strlen(option);
|
diff = longest_option - shell_strlen(option);
|
||||||
|
|
||||||
if (shell->ctx->vt100_ctx.printed_cmd++ % columns == 0) {
|
if (shell->ctx->vt100_ctx.printed_cmd++ % columns == 0) {
|
||||||
shell_fprintf(shell, SHELL_OPTION, "\r\n%s%s", tab, option);
|
shell_fprintf(shell, SHELL_OPTION, "\n%s%s", tab, option);
|
||||||
} else {
|
} else {
|
||||||
shell_fprintf(shell, SHELL_OPTION, "%s", option);
|
shell_fprintf(shell, SHELL_OPTION, "%s", option);
|
||||||
}
|
}
|
||||||
|
@ -1326,7 +1326,7 @@ int shell_start(const struct shell *shell)
|
||||||
vt100_color_set(shell, SHELL_NORMAL);
|
vt100_color_set(shell, SHELL_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
shell_raw_fprintf(shell->fprintf_ctx, "\r\n\n");
|
shell_raw_fprintf(shell->fprintf_ctx, "\n\n");
|
||||||
|
|
||||||
shell_state_set(shell, SHELL_STATE_ACTIVE);
|
shell_state_set(shell, SHELL_STATE_ACTIVE);
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ void shell_help_subcmd_print(const struct shell *shell)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "Subcommands:\r\n");
|
shell_fprintf(shell, SHELL_NORMAL, "Subcommands:\n");
|
||||||
|
|
||||||
/* Printing subcommands and help string (if exists). */
|
/* Printing subcommands and help string (if exists). */
|
||||||
cmd_idx = 0;
|
cmd_idx = 0;
|
||||||
|
|
|
@ -59,7 +59,7 @@ static inline void cursor_restore(const struct shell *shell)
|
||||||
*/
|
*/
|
||||||
static inline void cursor_next_line_move(const struct shell *shell)
|
static inline void cursor_next_line_move(const struct shell *shell)
|
||||||
{
|
{
|
||||||
shell_raw_fprintf(shell->fprintf_ctx, "\r\n");
|
shell_raw_fprintf(shell->fprintf_ctx, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Function sends 1 character to the shell instance. */
|
/* Function sends 1 character to the shell instance. */
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SHELL_MSG_SPECIFY_SUBCOMMAND "Please specify a subcommand.\r\n"
|
#define SHELL_MSG_SPECIFY_SUBCOMMAND "Please specify a subcommand.\n"
|
||||||
|
|
||||||
#define SHELL_DEFAULT_TERMINAL_WIDTH (80u) /* Default PuTTY width. */
|
#define SHELL_DEFAULT_TERMINAL_WIDTH (80u) /* Default PuTTY width. */
|
||||||
#define SHELL_DEFAULT_TERMINAL_HEIGHT (24u) /* Default PuTTY height. */
|
#define SHELL_DEFAULT_TERMINAL_HEIGHT (24u) /* Default PuTTY height. */
|
||||||
|
|
|
@ -112,7 +112,7 @@ static enum shell_wildcard_status commands_expand(const struct shell *shell,
|
||||||
SHELL_WARNING,
|
SHELL_WARNING,
|
||||||
"Command buffer is too short to"
|
"Command buffer is too short to"
|
||||||
" expand all commands matching"
|
" expand all commands matching"
|
||||||
" wildcard pattern: %s\r\n",
|
" wildcard pattern: %s\n",
|
||||||
pattern);
|
pattern);
|
||||||
break;
|
break;
|
||||||
} else if (ret_val != SHELL_WILDCARD_CMD_ADDED) {
|
} else if (ret_val != SHELL_WILDCARD_CMD_ADDED) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue