Lines Matching +full:high +full:- +full:dynamic +full:- +full:output
13 This module allows you to create and handle a shell with a user-defined command
15 interaction is required. This module is a Unix-like shell with these features:
19 * Support for static and dynamic commands.
22 * Built-in commands: :command:`clear`, :command:`shell`, :command:`colors`,
30 * Built-in handler to display help for the commands.
48 The module can be connected to any transport for command input and output.
59 * DUMMY - not a physical transport layer.
68 .. code-block:: none
80 `tab completion <tab-feature_>`_, and `history <history-feature_>`_
86 To configure Shell USB CDC ACM backend, simply add the snippet ``cdc-acm-console``
89 .. code-block:: console
91 west build -S cdc-acm-console [...]
95 - :zephyr_file:`snippets/cdc-acm-console/cdc-acm-console.conf`.
96 - :zephyr_file:`snippets/cdc-acm-console/cdc-acm-console.overlay`.
101 To configure Bluetooth LE (NUS) backend, simply add the snippet ``nus-console``
104 .. code-block:: console
106 west build -S nus-console [...]
110 - :zephyr_file:`snippets/nus-console/nus-console.conf`.
111 - :zephyr_file:`snippets/nus-console/nus-console.overlay`.
118 - :kconfig:option:`CONFIG_USE_SEGGER_RTT`
119 - :kconfig:option:`CONFIG_SHELL_BACKEND_RTT`
120 - :kconfig:option:`CONFIG_SHELL_BACKEND_SERIAL`
128 -----------
134 .. code-block:: none
150 --------------------------------------------------------
157 .. code-block:: none
159 JLinkRTTLogger -Device NRF52840_XXAA -RTTChannel 1 -if SWD -Speed 4000 ~/rtt.log
165 .. code-block:: none
184 * Dynamic subcommand (level > 0): Number and syntax does not need to be known
188 Commonly-used command groups
194 ----
196 - :kconfig:option:`CONFIG_GPIO`
197 - :kconfig:option:`CONFIG_GPIO_SHELL`
200 ---
202 - :kconfig:option:`CONFIG_I2C`
203 - :kconfig:option:`CONFIG_I2C_SHELL`
206 ------
208 - :kconfig:option:`CONFIG_SENSOR`
209 - :kconfig:option:`CONFIG_SENSOR_SHELL`
212 -----
214 - :kconfig:option:`CONFIG_FLASH`
215 - :kconfig:option:`CONFIG_FLASH_SHELL`
217 File-System
218 -----------
220 - :kconfig:option:`CONFIG_FILE_SYSTEM`
221 - :kconfig:option:`CONFIG_FILE_SYSTEM_SHELL`
228 * :c:macro:`SHELL_CMD_REGISTER` - Create root command. All root commands must
230 * :c:macro:`SHELL_COND_CMD_REGISTER` - Conditionally (if compile time flag is
232 * :c:macro:`SHELL_CMD_ARG_REGISTER` - Create root command with arguments.
234 * :c:macro:`SHELL_COND_CMD_ARG_REGISTER` - Conditionally (if compile time flag
237 * :c:macro:`SHELL_CMD` - Initialize a command.
238 * :c:macro:`SHELL_COND_CMD` - Initialize a command if compile time flag is set.
239 * :c:macro:`SHELL_EXPR_CMD` - Initialize a command if compile time expression is
240 non-zero.
241 * :c:macro:`SHELL_CMD_ARG` - Initialize a command with arguments.
242 * :c:macro:`SHELL_COND_CMD_ARG` - Initialize a command with arguments if compile
244 * :c:macro:`SHELL_EXPR_CMD_ARG` - Initialize a command with arguments if compile
245 time expression is non-zero.
246 * :c:macro:`SHELL_STATIC_SUBCMD_SET_CREATE` - Create a static subcommands
248 * :c:macro:`SHELL_SUBCMD_DICT_SET_CREATE` - Create a dictionary subcommands
250 * :c:macro:`SHELL_DYNAMIC_CMD_CREATE` - Create a dynamic subcommands array.
257 ---------------
266 .. code-block:: c
284 every time you want to use a pair: (string <-> corresponding data) in
296 .. code-block:: c
328 Dynamic commands
329 ----------------
331 Example code demonstrating how to create a root command with static and dynamic
332 subcommands. At the beginning dynamic command list is empty. New commands
335 .. code-block:: none
337 dynamic add <new_dynamic_command>
343 :alt: Command tree with static and dynamic commands.
345 .. code-block:: c
347 /* Buffer for 10 dynamic commands */
360 entry->syntax = dynamic_cmd_buffer[idx];
361 entry->handler = NULL;
362 entry->subcmd = NULL;
363 entry->help = "Show dynamic command name.";
365 /* if there are no more dynamic commands available
368 entry->syntax = NULL;
387 SHELL_CMD_REGISTER(dynamic, &m_sub_dynamic,
388 "Demonstrate dynamic command usage.", cmd_dynamic);
404 .. code-block:: c
422 --------------------------
426 * :c:macro:`root_cmd` - root command without a handler
427 * :c:macro:`cmd_xxx_h` - command has a handler
428 * :c:macro:`cmd_xxx` - command does not have a handler
461 ----------------
465 .. code-block:: c
491 ------------
493 Every user-defined command or subcommand can have its own help description.
499 or subcommand with ``-h`` or ``--help`` parameter.
502 ---------------
512 .. code-block:: c
520 * can be found using argv[-1].
523 argv[-1]);
534 Built-in commands
539 * :command:`clear` - Clears the screen.
540 * :command:`history` - Shows the recently entered commands.
541 * :command:`resize` - Must be executed when terminal width is different than 80
547 * :command:`default` - Shell will send terminal width = 80 to the
552 * :command:`select` - It can be used to set new root command. Exit to main
555 * :command:`shell` - Root command with useful shell-related subcommands like:
557 * :command:`echo` - Toggles shell echo.
558 * :command:`colors` - Toggles colored syntax. This might be helpful in
560 * :command:`stats` - Shows shell statistics.
562 .. _tab-feature:
569 It can also be used for partial or complete auto-completion of commands.
583 .. _history-feature:
603 .. code-block:: none
618 .. list-table:: Implemented meta keys
620 :header-rows: 1
622 * - Meta keys
623 - Action
624 * - :kbd:`Ctrl+a`
625 - Moves the cursor to the beginning of the line.
626 * - :kbd:`Ctrl+b`
627 - Moves the cursor backward one character.
628 * - :kbd:`Ctrl+c`
629 - Preserves the last command on the screen and starts a new command in
631 * - :kbd:`Ctrl+d`
632 - Deletes the character under the cursor.
633 * - :kbd:`Ctrl+e`
634 - Moves the cursor to the end of the line.
635 * - :kbd:`Ctrl+f`
636 - Moves the cursor forward one character.
637 * - :kbd:`Ctrl+k`
638 - Deletes from the cursor to the end of the line.
639 * - :kbd:`Ctrl+l`
640 - Clears the screen and leaves the currently typed command at the top of
642 * - :kbd:`Ctrl+n`
643 - Moves in history to next entry.
644 * - :kbd:`Ctrl+p`
645 - Moves in history to previous entry.
646 * - :kbd:`Ctrl+u`
647 - Clears the currently typed command.
648 * - :kbd:`Ctrl+w`
649 - Removes the word or part of the word to the left of the cursor. Words
651 * - :kbd:`Alt+b`
652 - Moves the cursor backward one word.
653 * - :kbd:`Alt+f`
654 - Moves the cursor forward one word.
674 An example non-thread safe usage:
676 .. code-block:: c
679 while ((char c = getopt(argc, argv, "abhc:")) != -1) {
691 .. code-block:: c
695 while ((char c = getopt(argc, argv, "abhc:")) != -1) {
699 cvalue = state->optarg;
736 messages are correctly multiplexed with shell output. Log messages from logger
750 set too high, the logger thread could be blocked and impact other logger
754 As the shell is a complex logger backend, it can not output logs if
766 separating them, the log can be captured or monitored without shell output or
774 <https://www.segger.com/products/debug-probes/j-link/technology/about-real-time-transfer/#j-link-rt…
789 .. code-block:: c
838 .. code-block:: none
851 are built-in commands which have been registered by
860 .. code-block:: none