From 506452c6fa4b7d408da0d332100f43a3102168ab Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 10 Mar 2011 14:42:28 +0000 Subject: add apps/ dir git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3360 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/examples/nsh/nsh_main.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'nuttx/examples') diff --git a/nuttx/examples/nsh/nsh_main.c b/nuttx/examples/nsh/nsh_main.c index 9981ad073..a13c6dae0 100644 --- a/nuttx/examples/nsh/nsh_main.c +++ b/nuttx/examples/nsh/nsh_main.c @@ -55,6 +55,10 @@ # include #endif +#ifdef CONFIG_EXAMPLES_NSH_BUILTIN_APPS +# include +#endif + #include "nsh.h" /**************************************************************************** @@ -487,6 +491,35 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, int argc, char *argv[]) } } +#ifdef CONFIG_EXAMPLES_NSH_BUILTIN_APPS + if (handler == cmd_unrecognized) + { + /* Try to find command within pre-built application list. */ + + if ((ret = exec_nuttapp(cmd, argv)) < 0) + { + if (errno != ENOENT) + { + return -errno; + } + } + else + { + /* Is the background mode or foreground mode desired? */ +#if 0 + if (argc > 1 && strcmp(argv[argc-1], "&") == 0) + { + } + else + { + waitpid(ret, ); + } +#endif + return ret; + } + } +#endif + ret = handler(vtbl, argc, argv); return ret; } -- cgit v1.2.3