]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_io: fix inode command help and argsmax
authorEric Sandeen <sandeen@redhat.com>
Sun, 2 Oct 2016 23:44:02 +0000 (10:44 +1100)
committerDave Chinner <david@fromorbit.com>
Sun, 2 Oct 2016 23:44:02 +0000 (10:44 +1100)
The short help implied that -n and -v were exclusive, and the longer
help wasn't particularly clear.

Further, argsmax is wrong; "-n -v num" is 3, not 2.

 # xfs_io -c "inode -n -v 123" /mnt/test2
 bad argument count 3 to inode, expected between 0 and 2 arguments
 # xfs_io -c "inode -vn 123" /mnt/test2
 128:32

Fix up all of those issues.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
io/open.c

index 3eaa0138f7b20f68585490936332c8ffbeb4e2dd..5efa739d8f8141df4a649bf2528e779f805877d1 100644 (file)
--- a/io/open.c
+++ b/io/open.c
@@ -757,16 +757,13 @@ inode_help(void)
 {
        printf(_(
 "\n"
-"Query physical information about the inode"
+"Query physical information about an inode"
 "\n"
-" Default:     -- Return true(1) or false(0) if any inode greater than\n"
-"                 32bits has been found in the filesystem\n"
-"[num]         -- Return inode number [num] or 0 if the inode [num] is in use\n"
-"                 or not\n"
-" -n [num]     -- Return the next valid inode after [num]\n"
-" -v           -- verbose mode\n"
-"                 Display the inode number and its physical size (in bits)\n"
-"                 according to the argument used\n"
+" Default:     -- Return 1 if any inode number greater than 32 bits exists in\n"
+"                 the filesystem, or 0 if none exist\n"
+" num          -- Return inode number [num] if in use, or 0 if not in use\n"
+" -n num       -- Return the next used inode after [num]\n"
+" -v           -- Verbose mode - display returned inode number's size in bits\n"
 "\n"));
 }
 
@@ -956,9 +953,9 @@ open_init(void)
 
        inode_cmd.name = "inode";
        inode_cmd.cfunc = inode_f;
-       inode_cmd.args = _("[-n | -v] [num]");
+       inode_cmd.args = _("[-nv] [num]");
        inode_cmd.argmin = 0;
-       inode_cmd.argmax = 2;
+       inode_cmd.argmax = 3;
        inode_cmd.flags = CMD_NOMAP_OK;
        inode_cmd.oneline =
                _("Query inode number usage in the filesystem");