mirror of
https://github.com/HEYAHONG/nuttx-apps.git
synced 2025-10-20 12:55:37 +08:00
nshlib/[cd|ls|pwd]: add support for local CWD(Current working directory)
This PR will still allow basic shell operations such as cd/ls/pwd to be used even when the environment is disabled. Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
14
nshlib/nsh.h
14
nshlib/nsh.h
@@ -867,10 +867,10 @@ int nsh_fileapp(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
|
||||
FAR char **argv, FAR const struct nsh_param_s *param);
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_DISABLE_ENVIRON
|
||||
/* Working directory support */
|
||||
|
||||
FAR const char *nsh_getcwd(void);
|
||||
FAR const char *nsh_getcwd(FAR struct nsh_vtbl_s *vtbl);
|
||||
#ifndef CONFIG_DISABLE_ENVIRON
|
||||
FAR char *nsh_getfullpath(FAR struct nsh_vtbl_s *vtbl,
|
||||
FAR const char *relpath);
|
||||
void nsh_freefullpath(FAR char *fullpath);
|
||||
@@ -1071,14 +1071,12 @@ int cmd_irqinfo(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
|
||||
# endif
|
||||
#endif /* !CONFIG_DISABLE_MOUNTPOINT */
|
||||
|
||||
#if !defined(CONFIG_DISABLE_ENVIRON)
|
||||
# ifndef CONFIG_NSH_DISABLE_CD
|
||||
#ifndef CONFIG_NSH_DISABLE_CD
|
||||
int cmd_cd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
|
||||
# endif
|
||||
# ifndef CONFIG_NSH_DISABLE_PWD
|
||||
#endif
|
||||
#ifndef CONFIG_NSH_DISABLE_PWD
|
||||
int cmd_pwd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
|
||||
# endif
|
||||
#endif /* !CONFIG_DISABLE_MOUNTPOINT */
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_NSH_DISABLE_ENV
|
||||
int cmd_env(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
|
||||
|
Reference in New Issue
Block a user