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

acassis 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 fe7f21749 nshlib: losetup/lomtd change "-s <sectsize>" to "-b 
<sectsize>"
fe7f21749 is described below

commit fe7f217497dc8a501e482f3f55b16b225543b52a
Author: Xiang Xiao <xiaoxi...@xiaomi.com>
AuthorDate: Sat Sep 23 14:13:01 2023 +0800

    nshlib: losetup/lomtd change "-s <sectsize>" to "-b <sectsize>"
    
    to follow host tool usage:
    
https://github.com/util-linux/util-linux/blob/master/sys-utils/losetup.c#L473
    
    Signed-off-by: Xiang Xiao <xiaoxi...@xiaomi.com>
---
 nshlib/nsh_command.c |  4 ++--
 nshlib/nsh_fscmds.c  | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/nshlib/nsh_command.c b/nshlib/nsh_command.c
index 3961e7c3a..a1f5445d0 100644
--- a/nshlib/nsh_command.c
+++ b/nshlib/nsh_command.c
@@ -303,7 +303,7 @@ static const struct cmdmap_s g_cmdmap[] =
 #ifndef CONFIG_DISABLE_MOUNTPOINT
 #  if defined(CONFIG_DEV_LOOP) && !defined(CONFIG_NSH_DISABLE_LOSETUP)
   CMD_MAP("losetup",  cmd_losetup,  3, 6,
-    "[-d <dev-path>] | [[-o <offset>] [-r] [-s <sect-size>] "
+    "[-d <dev-path>] | [[-o <offset>] [-r] [-b <sect-size>] "
     "<dev-path> <file-path>]"),
 #  endif
 #endif
@@ -320,7 +320,7 @@ static const struct cmdmap_s g_cmdmap[] =
 #  if defined(CONFIG_MTD_LOOP) && !defined(CONFIG_NSH_DISABLE_LOMTD)
   CMD_MAP("lomtd",    cmd_lomtd,    3, 9,
     "[-d <dev-path>] | [[-o <offset>] [-e <erase-size>] "
-    "[-s <sect-size>] <dev-path> <file-path>]]"),
+    "[-b <sect-size>] <dev-path> <file-path>]]"),
 #  endif
 #endif
 
diff --git a/nshlib/nsh_fscmds.c b/nshlib/nsh_fscmds.c
index 73b9292fa..559fc31f1 100644
--- a/nshlib/nsh_fscmds.c
+++ b/nshlib/nsh_fscmds.c
@@ -798,13 +798,13 @@ int cmd_losetup(FAR struct nsh_vtbl_s *vtbl, int argc, 
FAR char **argv)
   /* Get the losetup options:  Two forms are supported:
    *
    *   losetup -d <loop-device>
-   *   losetup [-o <offset>] [-r] [-s <sectsize> ] <loop-device> <filename>
+   *   losetup [-o <offset>] [-r] [-b <sectsize> ] <loop-device> <filename>
    *
    * NOTE that the -o and -r options are accepted with the -d option, but
    * will be ignored.
    */
 
-  while ((option = getopt(argc, argv, "d:o:rs:")) != ERROR)
+  while ((option = getopt(argc, argv, "d:o:rb:")) != ERROR)
     {
       switch (option)
         {
@@ -821,7 +821,7 @@ int cmd_losetup(FAR struct nsh_vtbl_s *vtbl, int argc, FAR 
char **argv)
           readonly = true;
           break;
 
-        case 's':
+        case 'b':
           sectsize = atoi(optarg);
           break;
 
@@ -1131,14 +1131,14 @@ int cmd_lomtd(FAR struct nsh_vtbl_s *vtbl, int argc, 
FAR char **argv)
   /* Get the lomtd options:  Two forms are supported:
    *
    *   lomtd -d <loop-device>
-   *   lomtd [-o <offset>] [-e erasesize] [-s sectsize]
+   *   lomtd [-o <offset>] [-e erasesize] [-b sectsize]
    *         <loop-device> <filename>
    *
    * NOTE that the -o and -r options are accepted with the -d option, but
    * will be ignored.
    */
 
-  while ((option = getopt(argc, argv, "d:o:e:s:")) != ERROR)
+  while ((option = getopt(argc, argv, "d:o:e:b:")) != ERROR)
     {
       switch (option)
         {
@@ -1155,7 +1155,7 @@ int cmd_lomtd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR 
char **argv)
           offset = atoi(optarg);
           break;
 
-        case 's':
+        case 'b':
           sectsize = atoi(optarg);
           break;
 

Reply via email to