diff --git a/nshlib/nsh.h b/nshlib/nsh.h index 6ce5bbf35..94e7e55d8 100644 --- a/nshlib/nsh.h +++ b/nshlib/nsh.h @@ -692,7 +692,7 @@ #ifndef CONFIG_NSH_DISABLESCRIPT # define NSH_NP_SET_OPTIONS "ex" /* Maintain order see nsh_npflags_e */ -# define NSH_NP_SET_OPTIONS_INIT (NSH_PFALG_SILENT) +# define NSH_NP_SET_OPTIONS_INIT (NSH_PFLAG_SILENT) #endif #if defined(CONFIG_DISABLE_ENVIRON) && defined(CONFIG_NSH_DISABLESCRIPT) @@ -758,9 +758,9 @@ struct nsh_loop_s enum nsh_npflags_e { - NSH_PFALG_IGNORE = 1, /* set for +e no exit on errors, + NSH_PFLAG_IGNORE = 1, /* set for +e no exit on errors, * cleared -e exit on error */ - NSH_PFALG_SILENT = 2, /* cleared -x print a trace of commands + NSH_PFLAG_SILENT = 2, /* cleared -x print a trace of commands * when parsing. * set +x no print a trace of commands */ }; diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index 231dc2526..ecea05791 100644 --- a/nshlib/nsh_parse.c +++ b/nshlib/nsh_parse.c @@ -1169,6 +1169,11 @@ static FAR char *nsh_argexpand(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline, envstr = nsh_envexpand(vtbl, ptr); + if ((vtbl->np.np_flags & NSH_PFLAG_SILENT) == 0) + { + nsh_output(vtbl," %s=%s\n", ptr, envstr ? envstr :"(null)"); + } + /* Concatenate the result of the operation with the accumulated * string. On failures to allocation memory, nsh_strcat will * just return value value of argument diff --git a/nshlib/nsh_script.c b/nshlib/nsh_script.c index cc20a82ed..37486c252 100644 --- a/nshlib/nsh_script.c +++ b/nshlib/nsh_script.c @@ -136,7 +136,7 @@ int nsh_script(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, * considerable amount of stack may be used. */ - if ((vtbl->np.np_flags & NSH_PFALG_SILENT) == 0) + if ((vtbl->np.np_flags & NSH_PFLAG_SILENT) == 0) { nsh_output(vtbl,"%s", buffer); } @@ -144,7 +144,7 @@ int nsh_script(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, ret = nsh_parse(vtbl, buffer); } } - while (pret && (ret == OK || (vtbl->np.np_flags & NSH_PFALG_IGNORE))); + while (pret && (ret == OK || (vtbl->np.np_flags & NSH_PFLAG_IGNORE))); /* Close the script file */