mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-18 08:52:01 +08:00
NSH now supports an MOTD string that will be presented after the greeting
This commit is contained in:
@@ -103,19 +103,36 @@
|
||||
|
||||
int nsh_session(FAR struct console_stdio_s *pstate)
|
||||
{
|
||||
FAR struct nsh_vtbl_s *vtbl;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(pstate);
|
||||
vtbl = &pstate->cn_vtbl;
|
||||
|
||||
/* Present a greeting */
|
||||
/* Present a greeting and possibly a Message of the Day (MOTD) */
|
||||
|
||||
fputs(g_nshgreeting, pstate->cn_outstream);
|
||||
|
||||
#ifdef CONFIG_NSH_MOTD
|
||||
# ifdef CONFIG_NSH_PLATFORM_MOTD
|
||||
/* Output the platform message of the day */
|
||||
|
||||
platform_motd(vtbl->iobuffer, IOBUFFERSIZE);
|
||||
fprintf(pstate->cn_outstream, "%s\n", vtbl->iobuffer);
|
||||
|
||||
# else
|
||||
/* Output the fixed message of the day */
|
||||
|
||||
fprintf(pstate->cn_outstream, "%s\n", g_nshmotd);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
fflush(pstate->cn_outstream);
|
||||
|
||||
/* Execute the login script */
|
||||
|
||||
#ifdef CONFIG_NSH_ROMFSRC
|
||||
(void)nsh_loginscript(&pstate->cn_vtbl);
|
||||
(void)nsh_loginscript(vtbl);
|
||||
#endif
|
||||
|
||||
/* Then enter the command line parsing loop */
|
||||
@@ -148,7 +165,7 @@ int nsh_session(FAR struct console_stdio_s *pstate)
|
||||
{
|
||||
/* Parse process the command */
|
||||
|
||||
(void)nsh_parse(&pstate->cn_vtbl, pstate->cn_line);
|
||||
(void)nsh_parse(vtbl, pstate->cn_line);
|
||||
fflush(pstate->cn_outstream);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user