shell: rename command 'set_module' to 'select'

select is more intuitive and easy to remember, and it is shorter too :)

Change-Id: Icc79e5cb88163344c1e2fcf65e313c33c4afa2cc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2017-01-08 13:23:49 -05:00 committed by Anas Nashif
parent a06d38af5a
commit 502f0c893c
2 changed files with 10 additions and 9 deletions

View file

@ -43,14 +43,14 @@ Help commands
Select module commands
======================
`set_module MODULE_NAME`
`select MODULE_NAME`
Use this command when using the shell only for one module. After entering this
command, you will not need to enter module name in further commands. If
the selected module has set a default shell prompt during its initialization,
the prompt will be changed to that one. Otherwise, the prompt will be
changed to the selected modules name to reflect the current module in use.
`set_module`
`select`
Clears selected module. Restores prompt as well.
Shell configuration
@ -108,8 +108,9 @@ use.
.. note::
Even if a default module was set in code level, it can be overwritten by
“set_module” shell command.
Even if a default module was set in code level, it can be overwritten by
"select" shell command.
You can use :c:func:`shell_register_default_module` in the following cases:
@ -125,7 +126,7 @@ More details on those optional functions can be found in
.. _shell_api_functions:
Shell Api Functions
Shell API Functions
*******************
.. doxygengroup:: _shell_api_functions
:project: Zephyr

View file

@ -240,7 +240,7 @@ static int show_help(int argc, char *argv[])
for (module = 0; module < NUM_OF_SHELL_ENTITIES; module++) {
printk("%s\n", __shell_cmd_start[module].module_name);
}
printk("\nTo select a module, enter 'set_module <module name>'.\n");
printk("\nTo select a module, enter 'select <module name>'.\n");
}
return 0;
@ -271,7 +271,7 @@ static int set_default_module(const char *name)
return 0;
}
static int set_module(int argc, char *argv[])
static int select_module(int argc, char *argv[])
{
if (argc == 1) {
default_module = -1;
@ -299,8 +299,8 @@ static shell_cmd_function_t get_cb(int argc, char *argv[])
return show_help;
}
if (!strcmp(first_string, "set_module")) {
return set_module;
if (!strcmp(first_string, "select")) {
return select_module;
}
if ((argc == 1) && (default_module == -1)) {