summaryrefslogtreecommitdiff
path: root/nuttx/examples/nsh/nsh_envcmds.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-11-14 15:11:26 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-11-14 15:11:26 +0000
commit33750aac935ce4f0f9c2e44ab1e43cd196c95ce9 (patch)
treea1ae161c2388d2d02a0ff95f1ec26a92082cbcd7 /nuttx/examples/nsh/nsh_envcmds.c
parenteb82956af4b42337b8b2baced2d3931769771ebd (diff)
downloadnuttx-33750aac935ce4f0f9c2e44ab1e43cd196c95ce9.tar.gz
nuttx-33750aac935ce4f0f9c2e44ab1e43cd196c95ce9.tar.bz2
nuttx-33750aac935ce4f0f9c2e44ab1e43cd196c95ce9.zip
Allow each NSH command to be disabled
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1234 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/nsh/nsh_envcmds.c')
-rw-r--r--nuttx/examples/nsh/nsh_envcmds.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/nuttx/examples/nsh/nsh_envcmds.c b/nuttx/examples/nsh/nsh_envcmds.c
index f8bedc461..b0d714550 100644
--- a/nuttx/examples/nsh/nsh_envcmds.c
+++ b/nuttx/examples/nsh/nsh_envcmds.c
@@ -209,6 +209,7 @@ void nsh_freefullpath(char *relpath)
****************************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_ENVIRON)
+#ifndef CONFIG_EXAMPLES_NSH_DISABLE_CD
int cmd_cd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
const char *path = argv[1];
@@ -260,11 +261,13 @@ int cmd_cd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
return ret;
}
#endif
+#endif
/****************************************************************************
* Name: cmd_echo
****************************************************************************/
+#ifndef CONFIG_EXAMPLES_NSH_DISABLE_ECHO
int cmd_echo(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
int i;
@@ -280,24 +283,28 @@ int cmd_echo(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
nsh_output(vtbl, "\n");
return OK;
}
+#endif
/****************************************************************************
* Name: cmd_pwd
****************************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_ENVIRON)
+#ifndef CONFIG_EXAMPLES_NSH_DISABLE_PWD
int cmd_pwd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
nsh_output(vtbl, "%s\n", nsh_getcwd());
return OK;
}
#endif
+#endif
/****************************************************************************
* Name: cmd_set
****************************************************************************/
#ifndef CONFIG_DISABLE_ENVIRON
+#ifndef CONFIG_EXAMPLES_NSH_DISABLE_SET
int cmd_set(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
int ret = setenv(argv[1], argv[2], TRUE);
@@ -308,12 +315,14 @@ int cmd_set(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
return ret;
}
#endif
+#endif
/****************************************************************************
* Name: cmd_unset
****************************************************************************/
#ifndef CONFIG_DISABLE_ENVIRON
+#ifndef CONFIG_EXAMPLES_NSH_DISABLE_UNSET
int cmd_unset(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
int ret = unsetenv(argv[1]);
@@ -324,3 +333,4 @@ int cmd_unset(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
return ret;
}
#endif
+#endif