mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-19 11:23:07 +08:00
apps/nshlib: Add support for NSH local variables if CONFIG_NSH_VARS are set. These are like environment variables but are local to NSH. The importance of this is that these variables are *not* inherited when NSH creates a new task. The new command 'export' was added. In this case, the NSH variable will be promoted to an environment variable and will then be inherited by any tasks executed by NSH.
This commit is contained in:
@@ -204,8 +204,12 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||
{ "exit", cmd_exit, 1, 1, NULL },
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_NSH_DISABLE_EXPORT
|
||||
{ "export", cmd_export, 2, 3, "[<name> [<value>]]" },
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_NSH_DISABLESCRIPT
|
||||
{ "false", cmd_false, 1, 1, NULL },
|
||||
{ "false", cmd_false, 1, 1, NULL },
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_NSH_DISABLE_FREE
|
||||
@@ -517,10 +521,8 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_DISABLE_ENVIRON
|
||||
# ifndef CONFIG_NSH_DISABLE_UNSET
|
||||
#ifndef CONFIG_NSH_DISABLE_UNSET
|
||||
{ "unset", cmd_unset, 2, 2, "<name>" },
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_NETUTILS_CODECS) && defined(CONFIG_CODECS_URLCODE)
|
||||
|
Reference in New Issue
Block a user