summaryrefslogtreecommitdiff
path: root/apps/nshlib/nsh_command.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-01-18 09:39:16 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-01-18 09:39:16 -0600
commitc9e72e0eed21a1c8c679bc094b0960dabf31c84d (patch)
tree9ef30c27fc3d15efa8db04cb1112d916316f3998 /apps/nshlib/nsh_command.c
parent1cc717520d36623c08f8b60f9cd7fede1bd8f1c1 (diff)
downloadpx4-nuttx-c9e72e0eed21a1c8c679bc094b0960dabf31c84d.tar.gz
px4-nuttx-c9e72e0eed21a1c8c679bc094b0960dabf31c84d.tar.bz2
px4-nuttx-c9e72e0eed21a1c8c679bc094b0960dabf31c84d.zip
NSH: Add a break command; if-then-else and looping behavior can not be configured out of the build for small systems that need minimal scripting capability
Diffstat (limited to 'apps/nshlib/nsh_command.c')
-rw-r--r--apps/nshlib/nsh_command.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/nshlib/nsh_command.c b/apps/nshlib/nsh_command.c
index 6ae3acfa7..ea028d463 100644
--- a/apps/nshlib/nsh_command.c
+++ b/apps/nshlib/nsh_command.c
@@ -119,6 +119,10 @@ static const struct cmdmap_s g_cmdmap[] =
# endif
#endif
+#if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_LOOPS)
+ { "break", cmd_break, 1, 1, NULL },
+#endif
+
#if CONFIG_NFILE_DESCRIPTORS > 0
# ifndef CONFIG_NSH_DISABLE_CAT
{ "cat", cmd_cat, 2, CONFIG_NSH_MAXARGUMENTS, "<path> [<path> [<path> ...]]" },
@@ -465,6 +469,7 @@ static inline void help_usage(FAR struct nsh_vtbl_s *vtbl)
nsh_output(vtbl, " <cmd> [> <file>|>> <file>]\n\n");
#endif
#ifndef CONFIG_NSH_DISABLESCRIPT
+#ifndef CONFIG_NSH_DISABLE_ITEF
nsh_output(vtbl, "OR\n");
nsh_output(vtbl, " if <cmd>\n");
nsh_output(vtbl, " then\n");
@@ -472,6 +477,8 @@ static inline void help_usage(FAR struct nsh_vtbl_s *vtbl)
nsh_output(vtbl, " else\n");
nsh_output(vtbl, " [sequence of <cmd>]\n");
nsh_output(vtbl, " fi\n\n");
+#endif
+#ifndef CONFIG_NSH_DISABLE_LOOPS
nsh_output(vtbl, "OR\n");
nsh_output(vtbl, " while <cmd>\n");
nsh_output(vtbl, " do\n");
@@ -483,6 +490,7 @@ static inline void help_usage(FAR struct nsh_vtbl_s *vtbl)
nsh_output(vtbl, " [sequence of <cmd>]\n");
nsh_output(vtbl, " done\n\n");
#endif
+#endif
}
#endif