wangchdo commented on code in PR #3168:
URL: https://github.com/apache/nuttx-apps/pull/3168#discussion_r2309196051


##########
nshlib/nsh_command.c:
##########
@@ -1338,3 +1338,80 @@ FAR const char *nsh_extmatch_getname(int index)
   return  g_cmdmap[index].cmd;
 }
 #endif
+
+#ifdef CONFIG_NSH_BUILTIN_APPS_AS_COMMAND
+
+#define MAX_ARGC 256
+
+/****************************************************************************
+ * Name: nsh_builtin
+ *
+ * Description:
+ *   Try to execute a built-in command (registered at compile time).
+ *   When CONFIG_NSH_BUILTIN_APPS_AS_COMMAND is defined, the command will
+ *   not be executed by creating a new task, but instead by calling the
+ *   corresponding builtin main() function directly.
+ *
+ * Input Parameters:
+ *   vtbl          - NSH vtable pointer, provides input/output interfaces
+ *                   (unused here)
+ *   cmd           - The command string to be executed
+ *   argv          - Argument array, argv[0] is the command itself
+ *
+ * Returned Value:
+ *   -1 (ERROR)  If the command does not exist, too many arguments, or
+ *               builtin lookup fails
+ *    Other      The return value from builtin->main(argc, argv)
+ *
+ ****************************************************************************/
+
+int nsh_builtin(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,

Review Comment:
   Agree and done



##########
nshlib/nsh_command.c:
##########
@@ -1338,3 +1338,80 @@ FAR const char *nsh_extmatch_getname(int index)
   return  g_cmdmap[index].cmd;
 }
 #endif
+
+#ifdef CONFIG_NSH_BUILTIN_APPS_AS_COMMAND
+
+#define MAX_ARGC 256

Review Comment:
   Agree and done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to