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:
Jakub Rzeszutko 2018-12-13 09:58:17 +01:00 committed by Carles Cufí
commit 4d491b283b
7 changed files with 25 additions and 25 deletions

View file

@ -35,7 +35,7 @@ static bool device_get_config_level(const struct shell *shell, int level)
info++) {
if (info->driver_api != NULL) {
devices = true;
shell_fprintf(shell, SHELL_NORMAL, "- %s\r\n",
shell_fprintf(shell, SHELL_NORMAL, "- %s\n",
info->config->name);
}
}
@ -49,28 +49,28 @@ static int cmd_device_levels(const struct shell *shell,
ARG_UNUSED(argv);
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);
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);
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);
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);
if (ret == false) {
shell_fprintf(shell, SHELL_NORMAL, "- None\r\n");
shell_fprintf(shell, SHELL_NORMAL, "- None\n");
}
return 0;
@ -83,10 +83,10 @@ static int cmd_device_list(const struct shell *shell,
ARG_UNUSED(argc);
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++) {
if (info->driver_api != NULL) {
shell_fprintf(shell, SHELL_NORMAL, "- %s\r\n",
shell_fprintf(shell, SHELL_NORMAL, "- %s\n",
info->config->name);
}
}

View file

@ -22,7 +22,7 @@ static int cmd_kernel_version(const struct shell *shell,
ARG_UNUSED(argc);
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_MINOR(version),
SYS_KERNEL_VER_PATCHLEVEL(version));
@ -35,7 +35,7 @@ static int cmd_kernel_uptime(const struct shell *shell,
ARG_UNUSED(argc);
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());
return 0;
}
@ -46,7 +46,7 @@ static int cmd_kernel_cycles(const struct shell *shell,
ARG_UNUSED(argc);
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());
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);
shell_fprintf((const struct shell *)user_data, SHELL_NORMAL,
"%s%p %-10s\r\n",
"%s%p %-10s\n",
(thread == k_current_get()) ? "*" : " ",
thread,
tname ? tname : "NA");
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.prio);
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);
}
@ -88,7 +88,7 @@ static int cmd_kernel_threads(const struct shell *shell,
ARG_UNUSED(argc);
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);
return 0;
}
@ -107,7 +107,7 @@ static void shell_stack_dump(const struct k_thread *thread, void *user_data)
pcnt = ((size - unused) * 100) / size;
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,
tname ? tname : "NA",
size, unused, size - unused, size, pcnt);

View file

@ -193,7 +193,7 @@ static void tab_item_print(const struct shell *shell, const char *option,
diff = longest_option - shell_strlen(option);
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 {
shell_fprintf(shell, SHELL_OPTION, "%s", option);
}
@ -1326,7 +1326,7 @@ int shell_start(const struct shell *shell)
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);

View file

@ -175,7 +175,7 @@ void shell_help_subcmd_print(const struct shell *shell)
return;
}
shell_fprintf(shell, SHELL_NORMAL, "Subcommands:\r\n");
shell_fprintf(shell, SHELL_NORMAL, "Subcommands:\n");
/* Printing subcommands and help string (if exists). */
cmd_idx = 0;

View file

@ -59,7 +59,7 @@ static inline void cursor_restore(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. */

View file

@ -13,7 +13,7 @@
extern "C" {
#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_HEIGHT (24u) /* Default PuTTY height. */

View file

@ -112,7 +112,7 @@ static enum shell_wildcard_status commands_expand(const struct shell *shell,
SHELL_WARNING,
"Command buffer is too short to"
" expand all commands matching"
" wildcard pattern: %s\r\n",
" wildcard pattern: %s\n",
pattern);
break;
} else if (ret_val != SHELL_WILDCARD_CMD_ADDED) {