shell: decrease built-in commands flash usage

Rephrase some help messages to decrease flash usage.
Deactivate shell history feature for test test_netusb_rndis

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
This commit is contained in:
Jakub Rzeszutko 2018-11-28 13:50:58 +01:00 committed by Anas Nashif
commit 1a220b4e80
6 changed files with 20 additions and 14 deletions

View file

@ -7,3 +7,5 @@ CONFIG_NET_PKT_TX_COUNT=24
CONFIG_NET_BUF_RX_COUNT=48 CONFIG_NET_BUF_RX_COUNT=48
CONFIG_NET_BUF_TX_COUNT=48 CONFIG_NET_BUF_TX_COUNT=48
CONFIG_NET_BUF_DATA_SIZE=128 CONFIG_NET_BUF_DATA_SIZE=128
CONFIG_SHELL_CMDS_RESIZE=n

View file

@ -1,2 +1,3 @@
CONFIG_NET_L2_BT=y CONFIG_NET_L2_BT=y
CONFIG_NET_L2_BT_SHELL=y CONFIG_NET_L2_BT_SHELL=y
CONFIG_SHELL_CMDS_RESIZE=n

View file

@ -4,3 +4,4 @@ CONFIG_USB_DEVICE_STACK=y
# Select USB Configurations # Select USB Configurations
CONFIG_USB_DEVICE_NETWORK_ECM=y CONFIG_USB_DEVICE_NETWORK_ECM=y
CONFIG_SHELL_CMDS_RESIZE=n

View file

@ -30,3 +30,4 @@ CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1"
CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2" CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2"
CONFIG_LOG=y CONFIG_LOG=y
CONFIG_SHELL_CMDS_RESIZE=n

View file

@ -35,5 +35,6 @@ tests:
- CONFIG_NET_PKT_TX_COUNT=32 - CONFIG_NET_PKT_TX_COUNT=32
- CONFIG_NET_TCP=n - CONFIG_NET_TCP=n
- CONFIG_SHELL_CMDS=n - CONFIG_SHELL_CMDS=n
- CONFIG_SHELL_HISTORY=n
tags: usb net zperf tags: usb net zperf
depends_on: usb_device depends_on: usb_device

View file

@ -8,12 +8,12 @@
#include "shell_ops.h" #include "shell_ops.h"
#include "shell_vt100.h" #include "shell_vt100.h"
#define SHELL_MSG_CMD_NOT_SUPPORTED "Command not supported.\n"
#define SHELL_HELP_CLEAR "Clear screen." #define SHELL_HELP_CLEAR "Clear screen."
#define SHELL_HELP_BACKSPACE_MODE "Toggle backspace key mode.\n" \ #define SHELL_HELP_BACKSPACE_MODE "Toggle backspace key mode.\n" \
"Some terminals are not sending separate escape code for" \ "Some terminals are not sending separate escape code for " \
"backspace and delete button. Hence backspace is not working as" \ "backspace and delete button. This command forces shell to interpret" \
"expected. This command can force shell to interpret delete" \ " delete key as backspace."
" escape as backspace."
#define SHELL_HELP_BACKSPACE_MODE_BACKSPACE "Set different escape" \ #define SHELL_HELP_BACKSPACE_MODE_BACKSPACE "Set different escape" \
" code for backspace and delete key." " code for backspace and delete key."
#define SHELL_HELP_BACKSPACE_MODE_DELETE "Set the same escape" \ #define SHELL_HELP_BACKSPACE_MODE_DELETE "Set the same escape" \
@ -28,9 +28,9 @@
#define SHELL_HELP_STATISTICS_RESET \ #define SHELL_HELP_STATISTICS_RESET \
"Reset shell statistics for the Logger module." "Reset shell statistics for the Logger module."
#define SHELL_HELP_RESIZE \ #define SHELL_HELP_RESIZE \
"Console gets terminal screen size or assumes 80 in case " \ "Console gets terminal screen size or assumes 80 in case" \
"the readout fails. It must be executed after each terminal " \ " the readout fails. It must be executed after each terminal" \
"width change to ensure correct text display." " width change to ensure correct text display."
#define SHELL_HELP_RESIZE_DEFAULT \ #define SHELL_HELP_RESIZE_DEFAULT \
"Assume 80 chars screen width and send this setting " \ "Assume 80 chars screen width and send this setting " \
"to the terminal." "to the terminal."
@ -38,8 +38,8 @@
#define SHELL_HELP_ECHO "Toggle shell echo." #define SHELL_HELP_ECHO "Toggle shell echo."
#define SHELL_HELP_ECHO_ON "Enable shell echo." #define SHELL_HELP_ECHO_ON "Enable shell echo."
#define SHELL_HELP_ECHO_OFF \ #define SHELL_HELP_ECHO_OFF \
"Disable shell echo. Arrows and buttons: Backspace, Delete, End, " \ "Disable shell echo. Editing keys and meta-keys are not handled"
"Home, Insert are not handled."
#define SHELL_HELP_SHELL "Useful, not Unix-like shell commands." #define SHELL_HELP_SHELL "Useful, not Unix-like shell commands."
#define SHELL_MSG_UNKNOWN_PARAMETER " unknown parameter: " #define SHELL_MSG_UNKNOWN_PARAMETER " unknown parameter: "
@ -363,7 +363,7 @@ static int cmd_history(const struct shell *shell, size_t argc, char **argv)
int ret; int ret;
if (!IS_ENABLED(CONFIG_SHELL_HISTORY)) { if (!IS_ENABLED(CONFIG_SHELL_HISTORY)) {
shell_fprintf(shell, SHELL_ERROR, "Command not supported.\n"); shell_fprintf(shell, SHELL_ERROR, SHELL_MSG_CMD_NOT_SUPPORTED);
return -ENOEXEC; return -ENOEXEC;
} }
@ -397,7 +397,7 @@ static int cmd_shell_stats_show(const struct shell *shell, size_t argc,
ARG_UNUSED(argv); ARG_UNUSED(argv);
if (!IS_ENABLED(CONFIG_SHELL_STATS)) { if (!IS_ENABLED(CONFIG_SHELL_STATS)) {
shell_fprintf(shell, SHELL_ERROR, "Command not supported.\n"); shell_fprintf(shell, SHELL_ERROR, SHELL_MSG_CMD_NOT_SUPPORTED);
return -ENOEXEC; return -ENOEXEC;
} }
@ -417,7 +417,7 @@ static int cmd_shell_stats_reset(const struct shell *shell,
ARG_UNUSED(argv); ARG_UNUSED(argv);
if (!IS_ENABLED(CONFIG_SHELL_STATS)) { if (!IS_ENABLED(CONFIG_SHELL_STATS)) {
shell_fprintf(shell, SHELL_ERROR, "Command not supported.\n"); shell_fprintf(shell, SHELL_ERROR, SHELL_MSG_CMD_NOT_SUPPORTED);
return -ENOEXEC; return -ENOEXEC;
} }
@ -470,7 +470,7 @@ static int cmd_resize(const struct shell *shell, size_t argc, char **argv)
int err; int err;
if (!IS_ENABLED(CONFIG_SHELL_CMDS_RESIZE)) { if (!IS_ENABLED(CONFIG_SHELL_CMDS_RESIZE)) {
shell_fprintf(shell, SHELL_ERROR, "Command not supported.\n"); shell_fprintf(shell, SHELL_ERROR, SHELL_MSG_CMD_NOT_SUPPORTED);
return -ENOEXEC; return -ENOEXEC;
} }