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

This commit is contained in:
Gregory Nutt
2014-01-18 09:39:16 -06:00
parent 45121c8709
commit 612d8ed14c
7 changed files with 149 additions and 19 deletions

View File

@@ -129,10 +129,11 @@ int nsh_script(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
do
{
/* Get the next line of input from the file */
/* Flush any output generated by the previous line */
fflush(stdout);
#ifndef CONFIG_NSH_DISABLE_LOOPS
/* Get the current file position. This is used to control
* looping. If a loop begins in the next line, then this file
* offset will be needed to locate the top of the loop in the
@@ -146,6 +147,7 @@ int nsh_script(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
{
nsh_output(vtbl, g_fmtcmdfailed, "loop", "ftell", NSH_ERRNO);
}
#endif
/* Now read the next line from the script file */