This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 2a08d17ed nsh_mmcmds: support "memdump -h/help" to show usage and 
sequence number
2a08d17ed is described below

commit 2a08d17ed685bff148c5c6e3bc7d5f78fd92929b
Author: Bowen Wang <[email protected]>
AuthorDate: Fri Sep 22 23:02:52 2023 +0800

    nsh_mmcmds: support "memdump -h/help" to show usage and sequence number
    
    Compare with "cat /proc/memdump", use "memdump -h/help" is more
    convenient.
    
    Signed-off-by: Bowen Wang <[email protected]>
---
 nshlib/nsh_mmcmds.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/nshlib/nsh_mmcmds.c b/nshlib/nsh_mmcmds.c
index 770a3b889..e84f6f599 100644
--- a/nshlib/nsh_mmcmds.c
+++ b/nshlib/nsh_mmcmds.c
@@ -63,6 +63,12 @@ int cmd_memdump(FAR struct nsh_vtbl_s *vtbl, int argc, FAR 
char **argv)
     {
       strlcpy(arg, "used", CONFIG_NSH_LINELEN);
     }
+  else if (argc >= 2 && (strcmp(argv[1], "-h") == 0 ||
+                         strcmp(argv[1], "help") == 0))
+    {
+      return nsh_catfile(vtbl, argv[0],
+                         CONFIG_NSH_PROC_MOUNTPOINT "/memdump");
+    }
   else
     {
       for (i = 1; i < argc; i++)

Reply via email to