shell: Add shell_set_root_cmd function
New function allows to set from the code the root command. It is an equivalent of calling 'select <rootcmd>' except it sets command for all shell instances. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
8a63c9c8c8
commit
450c6b44f9
4 changed files with 54 additions and 4 deletions
|
@ -837,6 +837,19 @@ void shell_help(const struct shell *shell);
|
|||
*/
|
||||
int shell_execute_cmd(const struct shell *shell, const char *cmd);
|
||||
|
||||
/** @brief Set root command for all shell instances.
|
||||
*
|
||||
* It allows setting from the code the root command. It is an equivalent of
|
||||
* calling select command with one of the root commands as the argument
|
||||
* (e.g "select log") except it sets command for all shell instances.
|
||||
*
|
||||
* @param cmd String with one of the root commands or null pointer to reset.
|
||||
*
|
||||
* @retval 0 if root command is set.
|
||||
* @retval -EINVAL if invalid root command is provided.
|
||||
*/
|
||||
int shell_set_root_cmd(const char *cmd);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue