2019-11-01 13:45:29 +01:00
|
|
|
# Shell configuration options
|
2016-12-23 20:06:46 +01:00
|
|
|
|
|
|
|
# Copyright (c) 2014-2015 Wind River Systems, Inc.
|
|
|
|
# Copyright (c) 2016 Intel Corporation
|
2018-11-27 12:11:04 +01:00
|
|
|
# Copyright (c) 2018 Nordic Semiconductor ASA
|
2017-01-19 02:01:01 +01:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2016-12-23 20:06:46 +01:00
|
|
|
|
2018-08-09 11:57:31 +02:00
|
|
|
menuconfig SHELL
|
2019-04-09 14:14:58 +02:00
|
|
|
bool "Shell"
|
2019-03-21 15:58:03 +01:00
|
|
|
imply LOG_RUNTIME_FILTERING
|
2018-08-09 09:56:10 +02:00
|
|
|
select POLL
|
|
|
|
|
|
|
|
if SHELL
|
|
|
|
|
|
|
|
module = SHELL
|
|
|
|
module-str = Shell
|
|
|
|
source "subsys/logging/Kconfig.template.log_config"
|
2021-10-01 10:53:29 +02:00
|
|
|
source "subsys/shell/backends/Kconfig.backends"
|
2018-08-09 09:56:10 +02:00
|
|
|
|
2021-02-26 15:50:11 +01:00
|
|
|
config SHELL_MINIMAL
|
|
|
|
bool "Default config to reduce flash and memory requirements"
|
|
|
|
help
|
|
|
|
This is a meta-configuration option to significantly reduce the flash
|
|
|
|
and memory requirements of the shell. Enabling it will choose Kconfig
|
|
|
|
defaults which favor reduced flash or memory requirements over extra
|
|
|
|
features.
|
|
|
|
|
2021-06-24 01:04:54 +02:00
|
|
|
config SHELL_THREAD_PRIORITY_OVERRIDE
|
|
|
|
bool "Override default shell thread priority"
|
|
|
|
help
|
|
|
|
Option to change the default value of shell thread priority.
|
|
|
|
|
|
|
|
if SHELL_THREAD_PRIORITY_OVERRIDE
|
|
|
|
config SHELL_THREAD_PRIORITY
|
|
|
|
int "Shell thread priority"
|
|
|
|
default 0
|
|
|
|
help
|
|
|
|
Set thread priority of the shell
|
|
|
|
endif
|
|
|
|
|
2018-08-09 09:56:10 +02:00
|
|
|
config SHELL_STACK_SIZE
|
|
|
|
int "Shell thread stack size"
|
2021-04-23 09:17:07 +02:00
|
|
|
default 3168 if OPENTHREAD_SHELL && OPENTHREAD_JOINER
|
2023-08-07 05:26:46 +02:00
|
|
|
default 3072 if 64BIT
|
2021-04-23 09:17:07 +02:00
|
|
|
default 2616 if OPENTHREAD_SHELL
|
2018-08-09 11:57:31 +02:00
|
|
|
default 2048 if MULTITHREADING
|
2018-08-09 09:56:10 +02:00
|
|
|
default 0 if !MULTITHREADING
|
|
|
|
help
|
|
|
|
Stack size for thread created for each instance.
|
|
|
|
|
|
|
|
config SHELL_BACKSPACE_MODE_DELETE
|
|
|
|
bool "Default escape code for backspace is DELETE (0x7F)"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Terminals have different escape code settings for backspace button.
|
|
|
|
Some terminals send code: 0x08 (backspace) other 0x7F (delete). When
|
|
|
|
this option is set shell will expect 0x7F for backspace key.
|
|
|
|
|
|
|
|
config SHELL_CMD_BUFF_SIZE
|
|
|
|
int "Shell command buffer size"
|
2021-02-26 15:50:11 +01:00
|
|
|
default 128 if SHELL_MINIMAL
|
2018-08-09 09:56:10 +02:00
|
|
|
default 256
|
|
|
|
help
|
2019-01-30 18:29:45 +01:00
|
|
|
Maximum command size in bytes. One byte is reserved for the string
|
|
|
|
terminator character.
|
2018-08-09 09:56:10 +02:00
|
|
|
|
|
|
|
config SHELL_PRINTF_BUFF_SIZE
|
|
|
|
int "Shell print buffer size"
|
|
|
|
default 30
|
|
|
|
help
|
|
|
|
Maximum text buffer size for fprintf function.
|
|
|
|
It is working like stdio buffering in Linux systems
|
|
|
|
to limit number of peripheral access calls.
|
|
|
|
|
2020-05-13 07:49:57 +02:00
|
|
|
config SHELL_DEFAULT_TERMINAL_WIDTH
|
|
|
|
int "Default terminal width"
|
|
|
|
default 80
|
|
|
|
help
|
|
|
|
Default terminal width is used to break lines.
|
|
|
|
|
|
|
|
config SHELL_DEFAULT_TERMINAL_HEIGHT
|
|
|
|
int "Default terminal height"
|
|
|
|
default 24
|
|
|
|
|
2018-08-09 09:56:10 +02:00
|
|
|
config SHELL_ARGC_MAX
|
|
|
|
int "Maximum arguments in shell command"
|
2020-09-18 10:39:35 +02:00
|
|
|
range 3 255
|
2022-08-25 14:59:25 +02:00
|
|
|
default 20
|
2018-08-09 09:56:10 +02:00
|
|
|
help
|
|
|
|
Maximum number of arguments that can build a command.
|
|
|
|
|
2020-11-18 14:24:57 +01:00
|
|
|
config SHELL_TAB
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "The Tab button support in shell"
|
2023-06-05 17:17:40 +02:00
|
|
|
default y if !SHELL_MINIMAL && !SHELL_BACKEND_RTT
|
2020-11-18 14:24:57 +01:00
|
|
|
help
|
|
|
|
Enable using the Tab button in the shell. The button
|
|
|
|
can be used for prompting commands, or for autocompletion.
|
|
|
|
This feature has high impact on flash usage.
|
|
|
|
|
|
|
|
config SHELL_TAB_AUTOCOMPLETION
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Commands autocompletion with the Tab button"
|
2020-11-18 14:24:57 +01:00
|
|
|
depends on SHELL_TAB
|
2021-02-26 15:50:11 +01:00
|
|
|
default y if !SHELL_MINIMAL
|
2020-11-18 14:24:57 +01:00
|
|
|
help
|
|
|
|
Enable commands and subcommands autocompletion with the Tab
|
|
|
|
key. This function can be deactivated to save some flash.
|
|
|
|
|
2023-06-21 16:03:36 +02:00
|
|
|
config SHELL_ASCII_FILTER
|
|
|
|
bool "Filter incoming ASCII characters"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Shell will not collect characters that are not in
|
|
|
|
ASCII range: <0, 127>. As a result filtered characters will not be
|
|
|
|
printed on the terminal and passed to the command handler.
|
|
|
|
|
2018-08-09 11:57:31 +02:00
|
|
|
config SHELL_WILDCARD
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Wildcard support in shell"
|
2018-08-09 11:57:31 +02:00
|
|
|
select FNMATCH
|
2021-02-26 15:50:11 +01:00
|
|
|
default y if !SHELL_MINIMAL
|
2018-08-09 11:57:31 +02:00
|
|
|
help
|
2018-10-29 13:25:49 +01:00
|
|
|
Enables using wildcards: * and ? in the shell.
|
2018-08-09 11:57:31 +02:00
|
|
|
|
2018-08-09 09:56:10 +02:00
|
|
|
config SHELL_ECHO_STATUS
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Echo on shell"
|
2018-08-09 09:56:10 +02:00
|
|
|
default y
|
|
|
|
help
|
|
|
|
If enabled shell prints back every input byte.
|
|
|
|
|
2021-03-04 20:28:05 +01:00
|
|
|
config SHELL_START_OBSCURED
|
|
|
|
bool "Display asterisk when echoing"
|
|
|
|
help
|
|
|
|
If enabled, don't echo actual character, but echo * instead.
|
|
|
|
This is used for login prompts.
|
|
|
|
|
2021-06-07 18:48:27 +02:00
|
|
|
config SHELL_VT100_COMMANDS
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "VT100 commands in shell"
|
2023-06-05 17:17:40 +02:00
|
|
|
default y if !SHELL_BACKEND_RTT
|
2021-06-07 18:48:27 +02:00
|
|
|
help
|
|
|
|
Enables VT100 commands in shell (e.g. cursor position, clear screen etc.).
|
|
|
|
|
2018-08-09 09:56:10 +02:00
|
|
|
config SHELL_VT100_COLORS
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Colors in shell"
|
2021-06-07 18:48:27 +02:00
|
|
|
depends on SHELL_VT100_COMMANDS
|
2021-02-26 15:50:11 +01:00
|
|
|
default y if !SHELL_MINIMAL
|
2018-08-09 09:56:10 +02:00
|
|
|
help
|
|
|
|
If enabled VT100 colors are used in shell (e.g. print errors in red).
|
|
|
|
|
2021-01-15 14:04:21 +01:00
|
|
|
config SHELL_GETOPT
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Threadsafe getopt support in shell"
|
2021-01-15 14:04:21 +01:00
|
|
|
select GETOPT
|
|
|
|
help
|
2021-07-01 11:00:15 +02:00
|
|
|
This config creates a separate getopt_state for the shell instance.
|
|
|
|
It ensures that using getopt with shell is thread safe.
|
|
|
|
When more threads are using getopt please call getopt_state_get to
|
|
|
|
get getopt state of the shell thread.
|
2021-01-15 14:04:21 +01:00
|
|
|
|
2018-08-09 09:56:10 +02:00
|
|
|
config SHELL_METAKEYS
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Metakeys"
|
2021-02-26 15:50:11 +01:00
|
|
|
default y if !SHELL_MINIMAL
|
2018-08-09 09:56:10 +02:00
|
|
|
help
|
2019-01-27 13:09:39 +01:00
|
|
|
Enables shell meta keys: Ctrl+a, Ctrl+b, Ctrl+c, Ctrl+d, Ctrl+e,
|
|
|
|
Ctrl+f, Ctrl+k, Ctrl+l, Ctrl+u, Ctrl+w, Alt+b, Alt+f
|
|
|
|
Meta keys will not be active when shell echo is set to off.
|
2018-08-09 09:56:10 +02:00
|
|
|
|
|
|
|
config SHELL_HELP
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Help message"
|
2021-02-26 15:50:11 +01:00
|
|
|
default y if !SHELL_MINIMAL
|
2018-08-09 09:56:10 +02:00
|
|
|
help
|
2021-01-14 12:31:07 +01:00
|
|
|
Enables shell functions for printing formatted help message.
|
|
|
|
|
|
|
|
config SHELL_HELP_OPT_PARSE
|
|
|
|
bool "Parse -h and --help options"
|
|
|
|
depends on SHELL_HELP
|
|
|
|
depends on !SHELL_GETOPT
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Shell parses command to find '-h' or '--help' string. If the shell
|
|
|
|
finds the string, it will automatically print a help message
|
|
|
|
for a command.
|
2018-08-09 09:56:10 +02:00
|
|
|
|
|
|
|
config SHELL_HELP_ON_WRONG_ARGUMENT_COUNT
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Printing help on wrong argument count"
|
2018-08-09 11:57:31 +02:00
|
|
|
depends on SHELL_HELP
|
2021-02-26 15:50:11 +01:00
|
|
|
default y if !SHELL_MINIMAL
|
2018-08-09 09:56:10 +02:00
|
|
|
|
2018-08-09 10:38:15 +02:00
|
|
|
config SHELL_HISTORY
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "History in shell"
|
2021-02-26 15:50:11 +01:00
|
|
|
default y if !SHELL_MINIMAL
|
2019-02-05 14:27:31 +01:00
|
|
|
select RING_BUFFER
|
2018-08-09 10:38:15 +02:00
|
|
|
help
|
|
|
|
Enable commands history. History can be accessed using up and down
|
2020-11-19 15:46:36 +01:00
|
|
|
arrows or Ctrl+n and Ctrl+p meta keys.
|
2018-08-09 10:38:15 +02:00
|
|
|
|
|
|
|
config SHELL_HISTORY_BUFFER
|
|
|
|
int "History buffer in bytes"
|
2021-02-26 15:50:11 +01:00
|
|
|
default 128 if SHELL_MINIMAL
|
2019-02-05 14:27:31 +01:00
|
|
|
default 512
|
kconfig: Replace some single-symbol 'if's with 'depends on'
I think people might be reading differences into 'if' and 'depends on'
that aren't there, like maybe 'if' being needed to "hide" a symbol,
while 'depends on' just adds a dependency.
There are no differences between 'if' and 'depends on'. 'if' is just a
shorthand for 'depends on'. They work the same when it comes to creating
implicit menus too.
The way symbols get "hidden" is through their dependencies not being
satisfied ('if'/'depends on' get copied up as a dependency on the
prompt).
Since 'if' and 'depends on' are the same, an 'if' with just a single
symbol in it can be replaced with a 'depends on'. IMO, it's best to
avoid 'if' there as a style choice too, because it confuses people into
thinking there's deep Kconfig magic going on that requires 'if'.
Going for 'depends on' can also remove some nested 'if's, which
generates nicer symbol information and docs, because nested 'if's really
are so simple/dumb that they just add the dependencies from both 'if's
to all symbols within.
Replace a bunch of single-symbol 'if's with 'depends on' to despam the
Kconfig files a bit and make it clearer how things work. Also do some
other minor related dependency refactoring.
The replacement isn't complete. Will fix up the rest later. Splitting it
a bit to make it more manageable.
(Everything above is true for choices, menus, and comments as well.)
Detected by tweaking the Kconfiglib parsing code. It's impossible to
detect after parsing, because 'if' turns into 'depends on'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 03:45:50 +01:00
|
|
|
depends on SHELL_HISTORY
|
2018-08-09 10:38:15 +02:00
|
|
|
help
|
|
|
|
Number of bytes dedicated for storing executed commands.
|
|
|
|
|
2018-08-09 11:40:02 +02:00
|
|
|
config SHELL_STATS
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Shell statistics"
|
2021-02-26 15:50:11 +01:00
|
|
|
default y if !SHELL_MINIMAL
|
2018-08-09 11:40:02 +02:00
|
|
|
|
2018-08-09 10:57:07 +02:00
|
|
|
config SHELL_CMDS
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Built-in commands"
|
2021-02-26 15:50:11 +01:00
|
|
|
default y if !SHELL_MINIMAL
|
2018-08-09 10:57:07 +02:00
|
|
|
help
|
|
|
|
Enable built-in commands like 'clear', 'history', etc.
|
|
|
|
|
|
|
|
config SHELL_CMDS_RESIZE
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Resize command"
|
2018-08-09 10:57:07 +02:00
|
|
|
depends on SHELL_CMDS
|
2021-06-07 18:48:27 +02:00
|
|
|
depends on SHELL_VT100_COMMANDS
|
2021-02-26 15:50:11 +01:00
|
|
|
default y if !SHELL_MINIMAL
|
2018-08-09 10:57:07 +02:00
|
|
|
help
|
|
|
|
By default shell assumes width of a terminal screen set to 80
|
|
|
|
characters. Each time terminal screen width is changed resize command
|
|
|
|
must be called to ensure correct text display on the terminal screen.
|
2019-01-30 18:29:45 +01:00
|
|
|
The resize command can be turned off to save code memory (~0,5k).
|
2018-08-09 10:57:07 +02:00
|
|
|
|
2019-05-16 11:02:53 +02:00
|
|
|
config SHELL_CMDS_SELECT
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Select command"
|
2019-05-16 11:02:53 +02:00
|
|
|
depends on SHELL_CMDS
|
|
|
|
help
|
|
|
|
This option enables select command. It can be used to set new root
|
|
|
|
command. Exit to main command tree is with alt+r.
|
|
|
|
|
2021-06-11 16:19:03 +02:00
|
|
|
config SHELL_CMD_ROOT
|
|
|
|
string "Set a root command at init"
|
|
|
|
help
|
|
|
|
This option sets a root command at shell init,
|
|
|
|
and when exiting to main command tree with alt+r.
|
|
|
|
|
2018-09-20 14:45:56 +02:00
|
|
|
config SHELL_LOG_BACKEND
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Shell log backend"
|
2021-11-19 07:59:23 +01:00
|
|
|
depends on LOG && !LOG_MODE_MINIMAL
|
2022-06-15 07:46:35 +02:00
|
|
|
select MPSC_PBUF
|
2022-09-01 10:07:30 +02:00
|
|
|
select LOG_OUTPUT
|
2018-09-20 14:45:56 +02:00
|
|
|
default y if LOG
|
2020-07-28 05:56:02 +02:00
|
|
|
help
|
|
|
|
When enabled, backend will use the shell for logging.
|
|
|
|
This option is enabled by default.
|
|
|
|
Disabling this option disables log output to all shell backends.
|
|
|
|
Disabling log output to a specific shell backend can be achieved
|
|
|
|
using the shell backend's LOG_LEVEL option
|
|
|
|
(e.g. CONFIG_SHELL_TELNET_INIT_LOG_LEVEL_NONE=y).
|
2018-09-20 14:45:56 +02:00
|
|
|
|
2022-09-05 07:16:21 +02:00
|
|
|
config SHELL_LOG_FORMAT_TIMESTAMP
|
|
|
|
bool "Format timestamp"
|
|
|
|
default y
|
|
|
|
depends on SHELL_LOG_BACKEND
|
|
|
|
help
|
|
|
|
Enable timestamp formatting.
|
|
|
|
|
2022-10-21 12:05:45 +02:00
|
|
|
config SHELL_AUTOSTART
|
|
|
|
bool "Auto-start shell at boot"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
If enabled, shell will be automatically started.
|
2022-09-05 07:16:21 +02:00
|
|
|
|
2023-04-26 00:59:19 +02:00
|
|
|
config SHELL_CMDS_RETURN_VALUE
|
|
|
|
bool "Retval command"
|
|
|
|
depends on SHELL_CMDS
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
This option enables the retval command. It is used to retrieve
|
|
|
|
the return value from the most recently executed command.
|
|
|
|
|
2018-08-09 15:03:58 +02:00
|
|
|
source "subsys/shell/modules/Kconfig"
|
|
|
|
|
2019-04-09 14:14:58 +02:00
|
|
|
endif # SHELL
|