JianyuWang0623 commented on code in PR #3480:
URL: https://github.com/apache/nuttx-apps/pull/3480#discussion_r3253207405
##########
nshlib/nsh_command.c:
##########
@@ -168,6 +168,14 @@ static const struct cmdmap_s g_cmdmap[] =
CMD_MAP("cd", cmd_cd, 1, 2, "[<dir-path>|-|~|..]"),
#endif
+#ifndef CONFIG_NSH_DISABLE_CHMOD
+ CMD_MAP("chmod", cmd_chmod, 3, 3, "<octal-mode> <path>"),
+#endif
+
+#ifndef CONFIG_NSH_DISABLE_CHOWN
+ CMD_MAP("chown", cmd_chown, 3, 3, "<uid>[:gid] <path>"),
Review Comment:
The implementation also accepts the [<uid>]:<gid> form (e.g. chown :5 /path,
where the uid is left unchanged), but the usage string only documents
<uid>[:gid]. Users who run help chown will not learn that the uid side may be
omitted.
Suggested change to keep the help text consistent with what the parser
actually accepts:
```diff
- CMD_MAP("chown", cmd_chown, 3, 3, "<uid>[:gid] <path>"),
+ CMD_MAP("chown", cmd_chown, 3, 3, "[<uid>][:<gid>] <path>"),
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]