@@ -17,6 +17,14 @@ module-str = Shell
1717source "subsys/logging/Kconfig.template.log_config"
1818source "subsys/shell/Kconfig.backends"
1919
20+ config SHELL_MINIMAL
21+ bool "Default config to reduce flash and memory requirements"
22+ help
23+ This is a meta-configuration option to significantly reduce the flash
24+ and memory requirements of the shell. Enabling it will choose Kconfig
25+ defaults which favor reduced flash or memory requirements over extra
26+ features.
27+
2028config SHELL_STACK_SIZE
2129 int "Shell thread stack size"
2230 default 2520 if OPENTHREAD_SHELL
@@ -35,6 +43,7 @@ config SHELL_BACKSPACE_MODE_DELETE
3543
3644config SHELL_CMD_BUFF_SIZE
3745 int "Shell command buffer size"
46+ default 128 if SHELL_MINIMAL
3847 default 256
3948 help
4049 Maximum command size in bytes. One byte is reserved for the string
@@ -67,7 +76,7 @@ config SHELL_ARGC_MAX
6776
6877config SHELL_TAB
6978 bool "Enable the Tab button support in shell"
70- default y
79+ default y if !SHELL_MINIMAL
7180 help
7281 Enable using the Tab button in the shell. The button
7382 can be used for prompting commands, or for autocompletion.
@@ -76,15 +85,15 @@ config SHELL_TAB
7685config SHELL_TAB_AUTOCOMPLETION
7786 bool "Enable commands autocompletion with the Tab button"
7887 depends on SHELL_TAB
79- default y
88+ default y if !SHELL_MINIMAL
8089 help
8190 Enable commands and subcommands autocompletion with the Tab
8291 key. This function can be deactivated to save some flash.
8392
8493config SHELL_WILDCARD
8594 bool "Enable wildcard support in shell"
8695 select FNMATCH
87- default y
96+ default y if !SHELL_MINIMAL
8897 help
8998 Enables using wildcards: * and ? in the shell.
9099
@@ -96,58 +105,59 @@ config SHELL_ECHO_STATUS
96105
97106config SHELL_VT100_COLORS
98107 bool "Enable colors in shell"
99- default y
108+ default y if !SHELL_MINIMAL
100109 help
101110 If enabled VT100 colors are used in shell (e.g. print errors in red).
102111
103112config SHELL_METAKEYS
104113 bool "Enable metakeys"
105- default y
114+ default y if !SHELL_MINIMAL
106115 help
107116 Enables shell meta keys: Ctrl+a, Ctrl+b, Ctrl+c, Ctrl+d, Ctrl+e,
108117 Ctrl+f, Ctrl+k, Ctrl+l, Ctrl+u, Ctrl+w, Alt+b, Alt+f
109118 Meta keys will not be active when shell echo is set to off.
110119
111120config SHELL_HELP
112121 bool "Enable help message"
113- default y
122+ default y if !SHELL_MINIMAL
114123 help
115124 Enables formatting help message when requested with '-h' or '--help'.
116125
117126config SHELL_HELP_ON_WRONG_ARGUMENT_COUNT
118127 bool "Enable printing help on wrong argument count"
119128 depends on SHELL_HELP
120- default y
129+ default y if !SHELL_MINIMAL
121130
122131config SHELL_HISTORY
123132 bool "Enable history in shell"
124- default y
133+ default y if !SHELL_MINIMAL
125134 select RING_BUFFER
126135 help
127136 Enable commands history. History can be accessed using up and down
128137 arrows or Ctrl+n and Ctrl+p meta keys.
129138
130139config SHELL_HISTORY_BUFFER
131140 int "History buffer in bytes"
141+ default 128 if SHELL_MINIMAL
132142 default 512
133143 depends on SHELL_HISTORY
134144 help
135145 Number of bytes dedicated for storing executed commands.
136146
137147config SHELL_STATS
138148 bool "Enable shell statistics"
139- default y
149+ default y if !SHELL_MINIMAL
140150
141151config SHELL_CMDS
142152 bool "Enable built-in commands"
143- default y
153+ default y if !SHELL_MINIMAL
144154 help
145155 Enable built-in commands like 'clear', 'history', etc.
146156
147157config SHELL_CMDS_RESIZE
148158 bool "Enable resize command"
149159 depends on SHELL_CMDS
150- default y
160+ default y if !SHELL_MINIMAL
151161 help
152162 By default shell assumes width of a terminal screen set to 80
153163 characters. Each time terminal screen width is changed resize command
0 commit comments