Skip to content

Commit

Permalink
nsh_mmcmds: support "memdump -h/help" to show usage and sequence number
Browse files Browse the repository at this point in the history
Compare with "cat /proc/memdump", use "memdump -h/help" is more
convenient.

Signed-off-by: Bowen Wang <[email protected]>
  • Loading branch information
CV-Bowen committed Jan 4, 2024
1 parent e55c0d9 commit bd95f3f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nshlib/nsh_mmcmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down

0 comments on commit bd95f3f

Please sign in to comment.